1#line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
13 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
22 #if !defined(ELC_BASE)
25 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
34 #if !defined(ELC_BASE_DEFS)
36 #define __builtin_is_my_dick_still_there() true
41 #include <type_traits>
46 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
56 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
66 typedef char32_t char_t;
68 typedef int64_t int_t;
70 typedef uint64_t uint_t;
72 typedef double float_t;
74 typedef long double float_size_t;
79 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
81 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
89 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
101 #if !defined(ELC_WARNING_LEVEL)
102 #define ELC_WARNING_LEVEL 4
105 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
116 #define BIT_POSSIBILITY 2
120 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
122 #if defined(_MSC_VER)
123 #pragma warning(push,ELC_WARNING_LEVEL)
124 #pragma warning(disable:4099)
125 #pragma warning(disable:26812)
126 #pragma warning(disable:4584)
127 #pragma warning(disable:4250)
128 #pragma warning(disable:26432)
129 #pragma warning(disable:26435)
130 #pragma warning(disable:26481)
131 #pragma warning(disable:26446)
132 #pragma warning(disable:26434)
133 #pragma warning(disable:26429)
134 #pragma warning(disable:26471)
135 #pragma warning(disable:26474)
136 #pragma warning(disable:26473)
137 #pragma warning(disable:26456)
138 #pragma warning(disable:26485)
139 #pragma warning(disable:26490)
140 #pragma warning(disable:26472)
141 #pragma warning(disable:26482)
142 #pragma warning(disable:26493)
144 #if defined(_MSC_VER)
145 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
146 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
147 #define push_msvc_warning() __pragma(warning(push))
148 #define pop_msvc_warning() __pragma(warning(pop))
149 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
151 #define suppress_msvc_warning(...)
152 #define disable_msvc_warning(...)
153 #define push_msvc_warning()
154 #define pop_msvc_warning()
155 #define push_and_disable_msvc_warning(...)
158 #if defined(ELC_VOID_NAME)
163 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
164 #define noexcept_as_auto MAGIC
165 #define constexpr_as(...) MAGIC constexpr
166 #define constexpr_as_auto MAGIC MAGIC constexpr
168 #define using_method_from_base_t(name,...) \
169 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
170 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
172 return base_t::name(forward<Args>(rest)...);\
175 #define using_method_from_value(name,value_name,...) \
176 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
177 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
179 return value_name.name(forward<Args>(rest)...);\
182 #define floop while(__builtin_is_my_dick_still_there())
183 #define enable_adl(name) void name()noexcept=delete
185 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
186 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
188 #define declvalue(...) (::std::declval<__VA_ARGS__>())
191 #define template_error(reason) static_assert(template_error_helper<T>,reason)
193 #define template_warning(reason) template_warning_helper<T>(reason)
196 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
197 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
199 #define is_common_attribute(name) public attribute<T,name<T>>
200 #define is_special_attribute(name) public attribute<T,name>
202 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
203 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
206 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
208 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
211 #define def_common_attribute_with_nothing(name) \
212 template<typename T>\
215 #define def_special_attribute_with_nothing(name) \
218 #define common_attribute_t template<class>class
219 #define special_attribute_t class
229 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
231 #define enabled_by_default class enable_state=void
233 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
235 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
237 #define enable_flag class enable_state
239 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
240 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
241 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
242 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
243 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
246 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
248 #define get_recursive_lambda_caller(name) \
249 lambda_with_catch(&)(auto&&...Args){\
250 return name(name,Args...);\
255 #define lambda_with_catch(...) [__VA_ARGS__]
257 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
259 #define lambda_RLSRRS _my_jb_super_sb_name_
267 #define elseif else if
271 #define _small_than_ <
273 #if defined(_MSC_VER)
280 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
282 #define BREAK_NAMESPACE }
285 #define template_name template
287 #define type_name class
289 #if defined(DEBUG) || defined(_DEBUG)
290 #define not_in_debug 0
292 #define not_in_debug 1
296 #define ec(ch) U ## ch
298 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
299 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
301 #define ELC_TEST_EVENTNAME(name)
304 #define override_instance_struct \
306 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
307 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
308 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
309 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
310 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
313 #define distinctive __declspec(dllexport)
319 #define force_inline __forceinline
320 #elif defined(__GNUC__)
321 #define force_inline __attribute__((always_inline)) inline
323 #define force_inline inline
327 #define with_no_vtable __declspec(novtable)
329 #define with_no_vtable
332 #define in_consteval (::std::is_constant_evaluated())
334 #define no_vtable_struct struct with_no_vtable
335 #define no_vtable_class class with_no_vtable
339 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
343 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
346 using namespace base;
349 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
351 inline void check_memory_lack()noexcept;
352 inline struct distinctive memory_lack_checker_t{
353 ~memory_lack_checker_t(){
356 }memory_lack_checker{};
361 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
371 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/template_helper.hpp"
384 constexpr bool template_error_helper=1000-7==114514;
388 template<
class T,
class U>
389 [[deprecated(
"this was a template warning."),nodiscard]]
390 inline auto template_warning_helper(U&&a)
noexcept{
return 0;}
394 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
395 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/using_std.hpp"
409 using ::std::forward;
410 using ::std::addressof;
426 using remove_cvref= ::std::remove_cvref_t<T>;
428 using remove_cv= ::std::remove_cv_t<T>;
430 using remove_ref= ::std::remove_reference_t<T>;
431 template<
bool B,
class T,
class F>
432 using conditional= ::std::conditional_t<B,T,F>;
434 using ::std::partial_ordering;
435 using ::std::weak_ordering;
436 using ::std::strong_ordering;
440 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
441 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/concept.hpp"
455 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
456 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/magic_number.hpp"
465 namespace magic_number{
472 constexpr auto gold=0.61803398874989484820458683436563811772030917980576286213544862270526046281890244970720720418939113748475408807538689175212663386222353693179318006076672635443338908659593958290563832266131992829026788067520876689250171169620703222104321626954862629631361443814975870122034080588795445474924618569536486444924104432077134494704956584678850987433944221254487706647809158846074998871240076521705751797883416625624940758906970400028121042762177111777805315317141011704666599146697987317613560067087480710131795236894275219484353056783002287856997829778347845878228911097625003026961561700250464338243776486102838312683303724292675263116533924731671112115881863851331620384005222165791286675294654906811317159934323597349498509040947621322298101726107059611645629909816290555208524790352406020172799747175342777592778625619432082750513121815628551222480939471234145170223735805772786160086883829523045926478780178899219902707769038953219681986151437803149974110692608867429622675756052317277752035361393621076738937645560606059216589466759551900400555908950229530942312482355212212415444006470340565734797663972394949946584578873039623090375033993856210242369025138680414577995698122445747178034173126453220416397232134044449487302315417676893752103068737880344170093954409627955898678723209512426893557309704509595684401755519881921802064052905518934947592600734852282101088194644544222318891319294689622002301443770269923007803085261180754519288770502109684249362713592518760777884665836150238913493333122310533923213624319263728910670503399282265263556209029798642472759772565508615487543574826471814145127000602389016207773224499435308899909501680328112194320481964387675863314798571911397815397807476150772211750826945863932045652098969855567814106968372884058746103378105444390943683583581381131168993855576975484149144534150912954070050194775486163075422641729394680367319805861833918328599130396072014455950449779212076124785645916160837059498786006970189409886400764436170933417270919143365013715;
475 constexpr auto gold_of_resize=gold+1;
478 constexpr auto pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019893809525720106548586327886593615338182796823030195203530185296899577362259941389124972177528347913151557485724245415069595082953311686172785588907509838175463746493931925506040092770167113900984882401285836160356370766010471018194295559619894676783744944825537977472684710404753464620804668425906949129331367702898915210475216205696602405803815019351125338243003558764024749647326391419927260426992279678235478163600934172164121992458631503028618297455570674983850549458858692699569092721079750930295532116534498720275596023648066549911988183479775356636980742654252786255181841757467289097777279380008164706001614524919217321721477235014144197356854816136115735255213347574184946843852332390739414333454776241686251898356948556209921922218427255025425688767179049460165346680498862723279178608578438382796797668145410095388378636095068006422512520511739298489608412848862694560424196528502221066118630674427862203919494504712371378696095636437191728746776465757396241389086583264599581339047802759009;
481 constexpr auto e = 2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059563073813232862794349076323382988075319525101901157383418793070215408914993488416750924476146066808226480016847741185374234544243710753907774499206955170276183860626133138458300075204493382656029760673711320070932870912744374704723069697720931014169283681902551510865746377211125238978442505695369677078544996996794686445490598793163688923009879312773617821542499922957635148220826989519366803318252886939849646510582093923982948879332036250944311730123819706841614039701983767932068328237646480429531180232878250981945581530175671736133206981125099618188159304169035159888851934580727386673858942287922849989208680582574927961048419844436346324496848756023362482704197862320900216099023530436994184914631409343173814364054625315209618369088870701676839642437814059271456354906130310720851038375051011574770417189861068739696552126715468895703503540212340784981933432106817012100562788023519303322474501585390473041995777709350366041699732972508868769664035557071622684471625607988265178713419512466520198918006308407507245458379639351364421067750539471789004518357551541252235905906872648786357525419112888773717663748602766063496035367947026923229718683277173932361920077745221262475186983349515101986426988784717193966497690708252174233656627259284406204302141137199227852699846988477023238238400556555178890876613601304770984386116870523105531491625172837327286760072481729876375698163354150746088386636406934704372066886512756882661497307886570156850169186474885416791545965072342877306998537139043002665307839877638503238182155355973235306860430106757608389086270498418885951380910304235957824951439885901131858358406674723702971497850841458530857813391562707603563907639473114554958322669457024941398316343323789759556808568362972538679132750555425244919435891284050452269538121791319145135009938463117740179715122837854601160359554028644059;
483 constexpr auto god=72;
486 template<
typename T> requires ::std::is_arithmetic_v<T>
487 [[nodiscard]]force_inline
constexpr bool is_negative(T x)
noexcept{
488 if constexpr(::std::is_signed_v<T>){
489 if constexpr(::std::is_floating_point_v<T>)
490 return ::std::signbit(x);
498 template<
typename T> requires ::std::is_arithmetic_v<T>
499 [[nodiscard]]force_inline
constexpr T copy_as_negative(
auto x,
bool negative=1)noexcept{
500 if constexpr(::std::is_signed_v<
decltype(x)>){
501 if constexpr(::std::is_floating_point_v<
decltype(x)>)
502 return(T)::std::copysign(x,negative?-1:1);
504 return(T)negative?T{}-x:x;
509 [[nodiscard]]force_inline
constexpr auto copy_as_negative(
auto x,
bool negative=1)noexcept{
510 return copy_as_negative<decltype(x)>(x,negative);
513 template<
typename T> requires ::std::is_arithmetic_v<T>
514 [[nodiscard]]force_inline
constexpr size_t to_size_t(T x)
noexcept{
515 if constexpr(::std::is_floating_point_v<T>)
516 return (
size_t)(ptrdiff_t)x;
521 template<
typename T> requires ::std::is_arithmetic_v<T>
522 [[nodiscard]]force_inline constexpr ::std::uintmax_t to_uintmax_t(T x)
noexcept{
523 if constexpr(::std::is_floating_point_v<T>)
524 return (::std::uintmax_t)(::std::intmax_t)x;
526 return (::std::uintmax_t)x;
529 template<
typename T1,
typename T2> requires ::std::is_arithmetic_v<T1> and ::std::is_arithmetic_v<T2>
530 [[nodiscard]]force_inline
constexpr auto mod(T1 a,T2 b){
531 if constexpr(::std::is_floating_point_v<T1>||::std::is_floating_point_v<T2>)
532 return ::std::fmod(a,b);
538 [[nodiscard]]force_inline
constexpr void set_rounding(
int mode){
539 if constexpr(::std::is_floating_point_v<T>)
540 ::std::fesetround(mode);
544 [[nodiscard]]force_inline
constexpr int get_rounding(){
545 if constexpr(::std::is_floating_point_v<T>)
546 return ::std::fegetround();
555 old_rounding=get_rounding<T>();
556 set_rounding<T>(new_rounding);
559 set_rounding<T>(old_rounding);
564 template<
class T> requires ::std::is_unsigned_v<T>
565 [[nodiscard]]force_inline
constexpr auto rotl_nomod(
const T v,
const auto R)
noexcept;
568 template<
class T> requires ::std::is_unsigned_v<T>
569 [[nodiscard]]force_inline
constexpr auto rotr_nomod(
const T v,
const auto r)
noexcept{
570 constexpr auto d = ::std::numeric_limits<T>::digits;
571 if constexpr(::std::is_unsigned_v<
decltype(r)>){
573 return static_cast<T
>(
static_cast<T
>(v >> r) |
static_cast<T
>(v << (d - r)));
579 return static_cast<T
>(
static_cast<T
>(v >> r) |
static_cast<T
>(v << (d - r)));
583 return rotl_nomod(v,0-r);
588 template<class T> requires ::std::is_unsigned_v<T>
589 [[nodiscard]]force_inline constexpr auto rotl_nomod(const T v,const auto r)noexcept{
590 constexpr auto d = ::std::numeric_limits<T>::digits;
591 if constexpr(::std::is_unsigned_v<
decltype(r)>){
593 return static_cast<T
>(
static_cast<T
>(v << r) | static_cast<T>(v >> (d - r)));
599 return static_cast<T
>(
static_cast<T
>(v << r) | static_cast<T>(v >> (d - r)));
603 return rotr_nomod(v,0-r);
608 template<class T> requires ::std::is_unsigned_v<T>
609 [[nodiscard]]force_inline constexpr auto rotr(const T v,const auto R)noexcept{
610 constexpr auto d = ::std::numeric_limits<T>::digits;
611 const auto r = mod(R,d);
612 return rotr_nomod(v,r);
616 template<
class T> requires ::std::is_unsigned_v<T>
617 [[nodiscard]]force_inline
constexpr auto rotl(
const T v,
const auto R)
noexcept{
618 constexpr auto d = ::std::numeric_limits<T>::digits;
619 const auto r = mod(R,d);
620 return rotl_nomod(v,r);
622 template<
class T> requires ::std::is_arithmetic_v<T>
624 static constexpr auto rot_offset_npos = ::std::numeric_limits<T>::digits;
627 force_inline
constexpr rot_iterator(
size_t offset)
noexcept:_offset(offset%rot_offset_npos){}
628 force_inline
constexpr rot_iterator&operator++()
noexcept{
630 if(_offset==rot_offset_npos)
634 force_inline
constexpr rot_iterator&operator--()
noexcept{
636 _offset=rot_offset_npos;
640 force_inline
constexpr rot_iterator operator++(
int)
noexcept{
645 force_inline
constexpr rot_iterator operator--(
int)
noexcept{
650 [[nodiscard]]force_inline
constexpr size_t value()
const noexcept{
656 template<
class T> requires ::std::is_unsigned_v<T>
657 [[nodiscard]]force_inline
constexpr auto rotl_nomod(
const T v,
const rot_iterator<T>&r)
noexcept{
658 return rotl_nomod(v,r.value());
662 template<
class T> requires ::std::is_unsigned_v<T>
663 [[nodiscard]]force_inline
constexpr auto rotr_nomod(
const T v,
const rot_iterator<T>&r)
noexcept{
664 return rotr_nomod(v,r.value());
668 template<
class T> requires ::std::is_unsigned_v<T>
669 [[nodiscard]]force_inline
constexpr auto rotl(
const T v,
const rot_iterator<T>&r)
noexcept{
670 return rotl_nomod(v,r);
674 template<
class T> requires ::std::is_unsigned_v<T>
675 [[nodiscard]]force_inline
constexpr auto rotr(
const T v,
const rot_iterator<T>&r)
noexcept{
676 return rotr_nomod(v,r);
679 template<
class T> requires ::std::is_arithmetic_v<T>
680 [[nodiscard]]force_inline
constexpr auto abs(
const T v)
noexcept{
681 if constexpr(::std::is_signed_v<T>)
687 template<
class T> requires ::std::is_arithmetic_v<T>
688 [[nodiscard]]force_inline
constexpr bool feq(
const T a,
const T b)
noexcept{
689 return abs(a-b)<=::std::numeric_limits<T>::epsilon();
692 template<
class T1,
class T2>
requires was_not_an_ill_form(declvalue(T1)-declvalue(T2))
693 [[nodiscard]]force_inline
constexpr auto sub(
const T1 a,
const T2 b)
noexcept{
694 if constexpr(::std::is_arithmetic_v<T1>&&::std::is_arithmetic_v<T2>){
695 if constexpr(::std::is_floating_point_v<T1>||::std::is_floating_point_v<T2>)
698 using signedT = ::std::make_signed_t<::std::common_type_t<T1,T2>>;
699 return static_cast<signedT
>(a)-
static_cast<signedT
>(b);
707 template<
class T> requires ::std::is_floating_point_v<T>
708 [[nodiscard]]force_inline
constexpr T exp(
const T v)
noexcept{
710 typedef decltype(::std::exp(v)) RT;
711 auto exp_impl = recursive_lambda(RT x,RT sum,RT n,
size_t i,RT t)
noexcept -> RT{
712 const auto epsilon=sum+t/n;
716 return self_recursion(x,epsilon,n*i,i+1,t*x);
718 auto exp_impl_caller = get_recursive_lambda_caller(exp_impl);
719 return exp_impl_caller(RT{v},RT{1},RT{1},2,RT{v});
722 return ::std::exp(v);
726 template<
class T> requires ::std::is_arithmetic_v<T>
727 [[nodiscard]]force_inline
constexpr auto log(
const T a)
noexcept{
729 typedef decltype(::std::log(a)) RT;
730 auto log_impl = recursive_lambda(
const RT x,
const RT y)
noexcept -> RT{
731 auto log_iter = lambda(RT x,RT y)
noexcept{
732 const auto exp_y = exp(y);
733 return y + T{2}*(x-exp_y)/(x+exp_y);
735 return RT(feq(y,log_iter(x,y)) ? y : self_recursion(x,log_iter(x,y)));
737 auto log_impl_caller = get_recursive_lambda_caller(log_impl);
738 return log_impl_caller((RT)a,RT{0});
741 return ::std::log(a);
743 template<
class T,
class U> requires ::std::is_arithmetic_v<T> && ::std::is_arithmetic_v<U>
744 [[nodiscard]]force_inline
constexpr auto log(
const T a,
const U b)
noexcept{
745 return log(a)/log(b);
749 template<
class T,
class U>
requires (::std::is_arithmetic_v<T> && ::std::is_arithmetic_v<U>)
750 [[nodiscard]]force_inline
constexpr auto pow(
const T a,
const U b)
noexcept{
752 typedef decltype(::std::pow(a,b)) RT;
753 return exp(RT(b)*log(RT(a)));
756 return ::std::pow(a,b);
760 template<
class T> requires ::std::is_floating_point_v<T>
761 [[nodiscard]]force_inline
constexpr auto trunc(
const T v)
noexcept{
763 typedef decltype(::std::trunc(v)) RT;
764 return static_cast<RT
>((::std::intmax_t)v);
767 return ::std::trunc(v);
771 template<
class T> requires ::std::is_floating_point_v<T>
772 [[nodiscard]]force_inline
constexpr auto ceil(
const T v)
noexcept{
774 typedef decltype(::std::ceil(v)) RT;
775 auto ceil_impl = lambda(T x, T y)
noexcept{
776 return feq(x,y) ? y : y+T{1};
778 return v<0 ? -
static_cast<T
>(to_uintmax_t(-v)) : ceil_impl(v,
static_cast<T
>(to_uintmax_t(v)));
781 return ::std::ceil(v);
785 template<
class T> requires ::std::is_arithmetic_v<T>
786 [[nodiscard]]
inline constexpr bool is_prime_num(T a)
788 if constexpr(::std::is_floating_point_v<T>)
808 if(mod(mod(a,6)-1,4))
810 T b=
static_cast<T
>(::std::sqrt(a));
823 if((!mod(a,c))||(!mod(a,(c+2))))
837 template<
class T> requires ::std::is_arithmetic_v<T>
838 [[nodiscard]]
inline constexpr T get_prime_num_big_or_eq_than(T a){
839 if constexpr(::std::is_floating_point_v<T>)
841 while(!is_prime_num(a))
845 push_and_disable_msvc_warning(26467);
847 [[nodiscard]]
inline constexpr size_t get_next_gold_size_to_resize_for_array(
size_t size){
851 return size_t(size*gold_of_resize);
854 [[nodiscard]]
inline constexpr size_t get_next_gold_size_to_resize_for_hash(
size_t size){
859 return size_t(get_prime_num_big_or_eq_than(size*gold_of_resize));
864 namespace linear_interpolation{
865 [[nodiscard]]
inline constexpr auto get_k(
auto y1,
auto y2,
auto δx)
noexcept{
870 [[nodiscard]]
inline constexpr auto get_k(
auto y1,
auto y2)
noexcept{
871 return get_k(y1,y2,1.0);
873 [[nodiscard]]
inline constexpr auto get_result(
auto y1,
auto k,
auto δx)
noexcept{
877 [[nodiscard]]
inline constexpr auto get_reverse_result(
auto k,
auto δx,
auto y)
noexcept{
883 using magic_number::is_negative;
884 using magic_number::copy_as_negative;
885 using magic_number::to_size_t;
886 using magic_number::mod;
887 using magic_number::set_rounding;
888 using magic_number::get_rounding;
889 using magic_number::rounding_auto_setter;
890 using magic_number::rotl;
891 using magic_number::rotr;
892 using magic_number::rotl_nomod;
893 using magic_number::rotr_nomod;
894 using magic_number::rot_iterator;
895 using magic_number::abs;
896 using magic_number::exp;
897 using magic_number::log;
898 using magic_number::pow;
899 using magic_number::ceil;
900 using magic_number::trunc;
901 using magic_number::get_next_gold_size_to_resize_for_array;
902 using magic_number::get_next_gold_size_to_resize_for_hash;
906 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
908 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/other.hpp"
919 template<
typename T,
typename U>
920 inline auto&assign(T&&a,U&&b)noexcept_as(a=b){
926 inline void discard(T&&){}
928 inline void just_a_use(T&&){}
931 distinctive
inline T const_default_value_of{};
933 enable_adl(the_destroy);
935 static void destroy(T*a)
noexcept{
936 if constexpr(was_not_an_ill_form(the_destroy(a)))
939 template_error(
"Please overload the function the_destroy in the namespace where this type is defined.");
944 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
946 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/cast.hpp"
955 push_and_disable_msvc_warning(
962 inline constexpr const T add_const(T a)
noexcept{
return a;}
965 inline constexpr const T&add_const(T&a)
noexcept{
return a;}
968 inline constexpr T&remove_const(
const T&a)
noexcept{
return const_cast<T&
>(a);}
971 inline constexpr const T*add_const(T*a)
noexcept{
return a;}
974 inline constexpr T*remove_const(
const T*a)
noexcept{return ::std::launder(
const_cast<T*
>(a));}
976 template<
typename T,
typename U>
977 inline constexpr T down_cast(U a)
noexcept{
return static_cast<T
>(a);}
982 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
983 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/special_flags.hpp"
993 #define defspecflag(name)\
994 constexpr struct name##_t{} name{}
996 defspecflag(never_ref_num_zero);
997 defspecflag(special_init);
1003 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1004 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/non_Xable.hpp"
1050 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1051 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/attribute.hpp"
1060 template<
class T,
typename attribute_name>
1063 template<
class U,special_attribute_t another_attribute_name>
1065 constexpr T*get_handle()
noexcept{
return down_cast<T*>(down_cast<attribute_name*>(
this));}
1067 template<
class U,special_attribute_t another_attribute_name>
1069 constexpr const T*get_handle()
const noexcept{
return down_cast<const T*>(down_cast<const attribute_name*>(
this));}
1071 template<
class T,special_attribute_t attribute_name>
1073 template<
class T,special_attribute_t attribute_name>
1076 template<
class T,common_attribute_t attribute_name>
1077 T* get_handle(attribute<T,attribute_name<T>>*a)
noexcept{
return get_handle<T,attribute_name<T>>(a);}
1078 template<
class T,common_attribute_t attribute_name>
1079 const T* get_handle(
const attribute<T,attribute_name<T>>*a)
noexcept{
return get_handle<T,attribute_name<T>>(a);}
1081 template<special_attribute_t attribute_name,
class T>
1082 auto attribute_ptr_cast(T*ptr)
noexcept{
1083 return static_cast<attribute_name*
>(ptr);
1085 template<special_attribute_t attribute_name,
class T>
1086 auto attribute_ptr_cast(
const T* ptr)
noexcept{
1087 return static_cast<const attribute_name*
>(ptr);
1089 template<common_attribute_t attribute_name,
class T>
1090 auto attribute_ptr_cast(T*ptr)
noexcept{
1091 return attribute_ptr_cast<attribute_name<remove_cvref<T>>>(ptr);
1094 template<special_attribute_t attribute_name,
class T>
1095 auto& attribute_cast(T&t)
noexcept{
1096 return*attribute_ptr_cast<attribute_name>(&t);
1098 template<common_attribute_t attribute_name,
class T>
1099 auto& attribute_cast(T&t)
noexcept{
1100 return*attribute_ptr_cast<attribute_name>(&t);
1103 template<special_attribute_t... attribute_names>
1109 template<common_attribute_t... attribute_names>
1117 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1118 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/special_attribute.hpp"
1132 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1133 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/type_info.hpp"
1146 const ::std::type_info* _m;
1148 constexpr type_id_t(const ::std::type_info&a)
noexcept:_m(&a){}
1149 constexpr type_id_t(
const type_id_t&a)
noexcept=
default;
1150 [[nodiscard]]
type_name_t get_name()
const noexcept;
1151 [[nodiscard]]
size_t get_hash()
const noexcept{
1152 return _m->hash_code();
1154 [[nodiscard]]
bool operator==(
const type_id_t&a)
const noexcept{
return *_m==*a._m;}
1161 [[nodiscard]]
type_name_t get_name()
const noexcept;
1162 [[nodiscard]]
size_t get_hash()
const noexcept{
1163 return _tid.get_hash();
1165 [[nodiscard]]
bool operator==(
const base_type_info_t&a)
const noexcept{
return _tid==a._tid;}
1166 [[nodiscard]]
bool operator==(const ::std::type_info&a)
const noexcept{
return _tid==type_id_t(a);}
1173 static constexpr bool same_as=::std::is_same_v<T,U>;
1175 static constexpr bool not_same_as=!same_as<U>;
1177 static constexpr bool base_on=::std::is_convertible_v<remove_cvref<T>*,remove_cvref<U>*>;
1179 static constexpr bool not_base_on=!base_on<U>;
1182 static constexpr bool can_convert_to=::std::is_convertible_v<T,U>;
1184 static constexpr bool can_t_convert_to=!can_convert_to<U>;
1186 static constexpr bool can_nothrow_convert_to=::std::is_nothrow_convertible_v<T,U>;
1188 static constexpr bool can_t_nothrow_convert_to=!can_nothrow_convert_to<U>;
1197 template<special_attribute_t attribute_name>
1198 static constexpr bool has_attribute_helper(){
1199 return base_on<attribute_name>;
1201 template<common_attribute_t attribute_name>
1202 static constexpr bool has_attribute_helper(){
1203 return has_attribute_helper<attribute_name<remove_cvref<T>>>();
1205 template<special_attribute_t attribute_name>
1206 static constexpr bool not_has_has_attribute_helper(){
1207 return!has_attribute_helper<attribute_name>();
1209 template<common_attribute_t attribute_name>
1210 static constexpr bool not_has_has_attribute_helper(){
1211 return!has_attribute_helper<attribute_name>();
1218 template<common_attribute_t... common_attribute_names>
1220 template<special_attribute_t... special_attribute_names>
1226 template<special_attribute_t... special_attribute_names>
1228 template<common_attribute_t... common_attribute_names>
1239 [[nodiscard]]type_name_t get_name()const noexcept;
1240 [[nodiscard]]
size_t get_hash()const noexcept{
1241 return base_type_info_t(*this).get_hash();
1246 constexpr type_info_t<T>type_info{};
1249 [[nodiscard]]
constexpr bool operator==(
const type_info_t<T>&,
const type_info_t<T>&){
return true;}
1250 template<
class T,
class U>
1251 [[nodiscard]]
constexpr bool operator==(
const type_info_t<T>&,
const type_info_t<U>&){
return false;}
1270 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1271 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/min_max.hpp"
1291 template<
class...Args>
1292 static constexpr bool able=was_not_an_ill_form(::std::min(declvalue(Args)...));
1294 template<
typename T>
1295 static constexpr bool get_limit_able=was_not_an_ill_form(::std::numeric_limits<T>::min());
1297 template<
class...Args>
requires able<Args...>
1298 [[nodiscard]]
constexpr auto operator()(Args&&...rest)
const{
1299 return ::std::min(forward<Args>(rest)...);
1301 template<
class T>
requires able<::std::initializer_list<T>>
1302 [[nodiscard]]
constexpr auto operator()(::std::initializer_list<T>l)
const{
1303 return ::std::min(l);
1305 template<
typename T>
requires get_limit_able<T>
1307 return ::std::numeric_limits<T>::min();
1319 template<
class...Args>
1320 static constexpr bool able=was_not_an_ill_form(::std::max(declvalue(Args)...));
1322 template<
typename T>
1323 static constexpr bool get_limit_able=was_not_an_ill_form(::std::numeric_limits<T>::max());
1325 template<
class...Args>
requires able<Args...>
1326 [[nodiscard]]
constexpr auto operator()(Args&&...rest)
const{
1327 return ::std::max(forward<Args>(rest)...);
1329 template<
class T>
requires able<::std::initializer_list<T>>
1330 [[nodiscard]]
constexpr auto operator()(::std::initializer_list<T>l)
const{
1331 return ::std::max(l);
1333 template<
typename T>
requires get_limit_able<T>
1335 return ::std::numeric_limits<T>::max();
1341 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1342 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/null_ptr.hpp"
1351 namespace null_ptr_n{
1365 enable_adl(the_get_null_ptr);
1366 template<
typename T>
1367 [[nodiscard]]
constexpr auto get_null_ptr()noexcept{
1368 suppress_msvc_warning(26462)
1369 constexpr auto null_as_T = static_cast<T*>(
nullptr);
1370 if constexpr(was_not_an_ill_form(the_get_null_ptr(null_as_T)))
1371 return the_get_null_ptr(null_as_T);
1373 template_error(
"please overload the function the_get_null_ptr in the namespace where this type is defined.");
1385 template<
typename T>
1386 [[nodiscard]]constexpr_as(get_null_ptr<remove_cvref<T>>())
auto base_get()
const noexcept{
return get_null_ptr<remove_cvref<T>>();}
1387 template<
typename T>
1388 [[nodiscard]]constexpr_as(base_get<T>())
operator T*()
const noexcept{
return down_cast<T*>(base_get<T>());}
1392 template<
typename T,
typename U=
decltype(*null_ptr.base_get<T>())>
1393 [[nodiscard]]
auto operator==(T*a,null_ptr_t)
noexcept{
1394 return null_ptr.base_get<T>()==
static_cast<const remove_ref<U>*
>(add_const(a));
1397 using null_ptr_n::can_t_use_default_null_ptr;
1398 using null_ptr_n::force_use_default_null_ptr;
1399 using null_ptr_n::null_ptr;
1400 typedef decltype(null_ptr) null_ptr_t;
1401 typedef decltype(
nullptr) nullptr_t;
1405 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1406 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/compare.hpp"
1444 template<
class T,
class U=T>
1445 static constexpr bool able= was_not_an_ill_form(declvalue(T)==declvalue(U));
1446 template<
class T,
class U=T>
1447 static constexpr bool nothrow= was_not_an_ill_form_and_noexcept(declvalue(T)==declvalue(U));
1449 template<
typename T,
typename U>
1450 [[nodiscard]]
constexpr auto operator()(T&&a,U&&b)
const noexcept(nothrow<T,U>){
1453 template<
typename T,
typename U>
1454 [[nodiscard]]
constexpr bool operator()(T*a,U*b,
size_t size)
const noexcept(nothrow<T,U>){
1461 template<
typename T,
typename U,
size_t N1,
size_t N2>
1462 [[nodiscard]]
constexpr bool operator()(T(&a)[N1],U(&b)[N2])
const noexcept(nothrow<T,U>){
1463 if constexpr(N1==N2)
1464 return operator()(a,b,N1);
1466 template_warning(
"N1!=N2");
1470 template<
typename T,
typename U>
1471 [[nodiscard]]
constexpr bool operator()(T*a,
size_t size1,U*b,
size_t size2)
const noexcept(nothrow<T,U>){
1473 return operator()(a,b,size1);
1477 template<
typename T,
typename U>
1478 [[nodiscard]]
constexpr bool operator()(T*a,
size_t size1,U*b,
end_by_zero_t)
const noexcept(nothrow<T,U>){
1480 if(*a!=*b || *b==U{0})
1487 template<
typename T,
typename U>
1488 [[nodiscard]]
constexpr bool operator()(T*a,
end_by_zero_t,U*b,
size_t size2)
const noexcept(nothrow<T,U>){
1489 return operator()(b,size2,a,end_by_zero);
1491 template<
typename T,
typename U>
1502 template<
typename T,
typename U>
1505 if(*a!=*b || *b==U{0})
1515 template<
typename T>
1516 [[nodiscard]]
constexpr auto is_eq(T&&a,T&&b)noexcept_as(&a==&b){
1519 template<
typename T>
1520 [[nodiscard]]
constexpr auto is_not_eq(T&&a,T&&b)noexcept_as(!is_eq(a,b)){
1553 template<
class T,
class U=T>
1554 static constexpr bool r_able= was_not_an_ill_form(declvalue(T)<=>declvalue(U));
1556 template<
class T,
class U=T>
1557 static constexpr bool able= r_able<T,U> ||
1558 was_not_an_ill_form(
1559 declvalue(T)==declvalue(U),
1560 declvalue(T)<declvalue(U),
1561 declvalue(U)<declvalue(T)
1563 template<
class T,
class U=T>
1564 static constexpr bool nothrow= was_not_an_ill_form_and_noexcept(declvalue(T)<=>declvalue(U)) ||
1565 was_not_an_ill_form_and_noexcept(
1566 declvalue(T)==declvalue(U),
1567 declvalue(T)<declvalue(U),
1568 declvalue(U)<declvalue(T)
1572 template<
class T,
class U>
1573 [[nodiscard]]
static constexpr auto base_call(T&&a,U&&b)
noexcept(nothrow<T,U>){
1575 if constexpr(r_able<T,U>)
1577 else return a == b ? partial_ordering::equivalent :
1578 a < b ? partial_ordering::less :
1579 b < a ? partial_ordering::greater :
1580 partial_ordering::unordered ;
1583 template<
class T,
class U=T>
1584 using type=
decltype(base_call(declvalue(T),declvalue(U)));
1586 template<
typename T,
typename U>
1587 [[nodiscard]]
constexpr auto operator()(T&&a,U&&b)
const noexcept(nothrow<T,U>){
1588 return base_call(a,b);
1590 template<
typename T,
typename U>
1591 [[nodiscard]]
constexpr auto operator()(T*a,U*b,
size_t size)
const noexcept(nothrow<T,U>){
1593 if(
auto tmp=base_call(*(a++),*(b++)); tmp!=0)
1596 return strong_ordering::equivalent;
1598 template<
typename T,
typename U,
size_t N1,
size_t N2>
1599 [[nodiscard]]
constexpr auto operator()(T(&a)[N1],U(&b)[N2])
const noexcept(nothrow<T,U>){
1600 if constexpr(N1==N2)
1601 return operator()(a,b,N1);
1603 template_warning(
"N1!=N2");
1607 template<
typename T,
typename U>
1608 [[nodiscard]]
constexpr auto operator()(T*a,
size_t size1,U*b,
size_t size2)
const noexcept(nothrow<T,U>){
1609 type<T,U> tmp=size1<=>size2;
1613 return operator()(a,b,size1);
1615 template<
typename T,
typename U>
1616 [[nodiscard]]
constexpr auto operator()(T*a,
size_t size1,U*b,
end_by_zero_t)
const noexcept(nothrow<T,U>){
1617 type<T,U> tmp=strong_ordering::equivalent;
1620 return strong_ordering::greater;
1622 tmp=base_call(*a,*b);
1626 return *b==U{0}?tmp:strong_ordering::less;
1628 template<
typename T,
typename U>
1629 [[nodiscard]]
constexpr auto operator()(T*a,
end_by_zero_t,U*b,
size_t size2)
const noexcept(nothrow<T,U>){
1630 type<T,U> tmp=strong_ordering::equivalent;
1633 return strong_ordering::less;
1635 tmp=base_call(*a,*b);
1639 return *b==U{0}?tmp:strong_ordering::less;
1641 template<
typename T,
typename U>
1643 type<T,U> tmp=strong_ordering::equivalent;
1646 return *b==U{0}?tmp:strong_ordering::less;
1648 tmp=base_call(*a,*b);
1653 template<
typename T,
typename U>
1655 type<T,U> tmp=strong_ordering::equivalent;
1658 return strong_ordering::greater;
1660 tmp=base_call(*a,*b);
1666 template<
typename T,
typename U>
1667 [[nodiscard]]
constexpr auto lexicographical(T*a,
size_t size1,U*b,
size_t size2)
const noexcept(nothrow<T,U>){
1668 if(
auto tmp=
operator()(a,b,min(size1,size2)); tmp!=0)
1671 return size1<=>size2;
1673 template<
typename T,
typename U,
size_t N1,
size_t N2>
1674 [[nodiscard]]
constexpr auto lexicographical(T(&a)[N1],U(&b)[N2])
const noexcept(nothrow<T,U>){
1675 return lexicographical(a,N1,b,N2);
1677 template<
typename T,
typename U>
1678 [[nodiscard]]
constexpr auto lexicographical(T*a,
size_t size1,U*b,
end_by_zero_t)
const noexcept(nothrow<T,U>){
1681 return strong_ordering::greater;
1682 if(
auto tmp=base_call(*a,*b); tmp!=0)
1687 return *b==U{0}?strong_ordering::equivalent:
1688 strong_ordering::less;
1690 template<
typename T,
typename U>
1691 [[nodiscard]]
constexpr auto lexicographical(T*a,
end_by_zero_t,U*b,
size_t size2)
const noexcept(nothrow<T,U>){
1694 return strong_ordering::less;
1695 if(
auto tmp=base_call(*a,*b); tmp!=0)
1700 return *b==U{0}?strong_ordering::equivalent:
1701 strong_ordering::less;
1703 template<
typename T,
typename U>
1707 return *b==U{0}?strong_ordering::equivalent:
1708 strong_ordering::less;
1709 if(
auto tmp=base_call(*a,*b); tmp!=0)
1715 template<
typename T,
typename U>
1719 return strong_ordering::greater;
1720 if(
auto tmp=base_call(*a,*b); tmp!=0)
1725 return strong_ordering::equivalent;
1728 [[nodiscard]]
constexpr auto reverse(partial_ordering odr)
const noexcept{
1729 if(odr==partial_ordering::greater)
1730 return partial_ordering::less;
1731 elseif(odr==partial_ordering::less)
1732 return partial_ordering::greater;
1736 [[nodiscard]]
constexpr auto reverse(weak_ordering odr)
const noexcept{
1737 if(odr==weak_ordering::greater)
1738 return weak_ordering::less;
1739 elseif(odr==weak_ordering::less)
1740 return weak_ordering::greater;
1744 [[nodiscard]]
constexpr auto reverse(strong_ordering odr)
const noexcept{
1745 if(odr==strong_ordering::greater)
1746 return strong_ordering::less;
1747 elseif(odr==strong_ordering::less)
1748 return strong_ordering::greater;
1756 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1757 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/note.hpp"
1767 #define def_note(name)\
1768 template<typename T>\
1771 force_inline constexpr name##_t(T a):value(a){}\
1773 force_inline constexpr name##_t(name##_t<U>a):value(a.value){}\
1774 force_inline constexpr operator T(){return value;}\
1775 force_inline constexpr T operator()(){return value;}\
1777 template<typename T>\
1778 constexpr name##_t<T>name(T v){return{v};}
1787 namespace note=note_n;
1791 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1792 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/array_like.hpp"
1801 namespace array_like_n{
1803 [[nodiscard]]
inline constexpr size_t size_of_array_like(T&&)noexcept{
return 1;}
1804 template<
class T,
size_t N>
1805 [[nodiscard]]
inline constexpr size_t size_of_array_like(T(&)[N])
noexcept{
return N;}
1807 [[nodiscard]]
inline size_t size_of_array_like(::std::initializer_list<T>&a)
noexcept{
return a.size();}
1810 [[nodiscard]]
inline constexpr auto begin_of_array_like(T&&a)
noexcept{
return addressof(a);}
1811 template<
class T,
size_t N>
1812 [[nodiscard]]
inline constexpr auto begin_of_array_like(T(&a)[N])
noexcept{
return addressof(a[0]);}
1814 [[nodiscard]]
inline const T* begin_of_array_like(::std::initializer_list<T>&a)
noexcept{
return a.begin();}
1817 [[nodiscard]]
inline auto end_of_array_like(T&&a)
noexcept{
return begin_of_array_like(a)+size_of_array_like(a);}
1820 constexpr bool is_array_like=was_not_an_ill_form_with_parameter(
1822 begin_of_array_like(v);
1823 size_of_array_like(v);
1828 constexpr bool is_signal_value_for_array_like=type_info<remove_cvref<
decltype(*begin_of_array_like(declvalue(T)))>> == type_info<T>;
1830 constexpr bool is_not_signal_value_for_array_like=!is_signal_value_for_array_like<T>;
1832 template<
class T,
class U>
1833 constexpr bool is_array_like_for=was_not_an_ill_form_with_parameter(
1835 begin_of_array_like<T>(v);
1836 size_of_array_like<T>(v);
1842 typedef T* iterator;
1843 typedef const T* const_iterator;
1850 template<
class U>
requires is_array_like_for<T,U>
1851 explicit constexpr_as_auto
array_like_view_t(U&&a)noexcept_as(begin_of_array_like<T>(a),size_of_array_like<T>(a)):
array_like_view_t(begin_of_array_like<T>(a),size_of_array_like<T>(a)){}
1854 void swap_with(
this_t&b)noexcept_as(swap(_begin,b._begin),swap(_size,b._size)){
1855 swap(_begin,b._begin);
1856 swap(_size,b._size);
1859 [[nodiscard]]
constexpr const_iterator c_str()
const noexcept{
return _begin;}
1860 [[nodiscard]]
constexpr size_t size()
const noexcept{
return _size;}
1862 [[nodiscard]]
constexpr iterator begin()
noexcept requires(type_info<iterator>!=type_info<const_iterator>){
return _begin;}
1863 [[nodiscard]]
constexpr iterator end()
noexcept requires(type_info<iterator>!=type_info<const_iterator>){
return begin()+size();}
1864 [[nodiscard]]
constexpr const_iterator begin()
const noexcept{
return _begin;}
1865 [[nodiscard]]
constexpr const_iterator end()
const noexcept{
return begin()+size();}
1867 [[nodiscard]]
constexpr const_iterator cbegin()
const noexcept{
return remove_const(
this)->begin();}
1868 [[nodiscard]]
constexpr const_iterator cend()
const noexcept{
return remove_const(
this)->end();}
1870 [[nodiscard]]
constexpr bool empty()
const noexcept{
return size();}
1872 [[nodiscard]]
constexpr T&operator[](
size_t pos)
noexcept{
return begin()[pos];}
1873 [[nodiscard]]
constexpr const T&operator[](
size_t pos)
const noexcept{
return remove_const(*
this)[pos];}
1875 [[nodiscard]]
constexpr auto operator<=>(
this_t a)
noexcept(compare.nothrow<T>){
1876 return compare(_begin,_size,a._begin,a._size);
1878 [[nodiscard]]
constexpr auto operator==(
this_t a)
noexcept(equal.nothrow<T>){
1879 return equal(_begin,_size,a._begin,a._size);
1882 template<
typename T>
1885 using base_t::base_t;
1887 [[nodiscard]]
constexpr static size_t get_length_of(T*ptr){
1888 if(*ptr)
return get_length_of(ptr+1)+1;
1896 [[nodiscard]]
inline constexpr T* begin_of_array_like(
array_like_view_t<T>&a)
noexcept requires(type_info<T>!=type_info<const T>){
return a.begin();}
1898 [[nodiscard]]
inline constexpr auto begin_of_array_like(
const array_like_view_t<T>&a)
noexcept{
return a.begin();}
1900 [[nodiscard]]
inline constexpr T* begin_of_array_like(
array_like_view_t<remove_cv<T>>&a)
noexcept{
return a.begin();}
1902 [[nodiscard]]
inline constexpr size_t size_of_array_like(
const array_like_view_t<T>&a)
noexcept{
return a.size();}
1904 using array_like_n::size_of_array_like;
1905 using array_like_n::begin_of_array_like;
1906 using array_like_n::end_of_array_like;
1907 using array_like_n::is_array_like;
1908 using array_like_n::is_signal_value_for_array_like;
1909 using array_like_n::is_not_signal_value_for_array_like;
1910 using array_like_n::is_array_like_for;
1911 using array_like_n::array_like_view_t;
1912 using array_like_n::array_end_by_zero_t;
1916 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1917 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/data.hpp"
1929 template<
class T> requires ::std::is_integral_v<T>
1930 constexpr size_t number_of_possible_values_per=max(type_info<::std::make_unsigned_t<T>>)+
size_t{1};
1935 constexpr size_t bitnumof=
sizeof(T)*CHAR_BIT;
1942 [[nodiscard]]
constexpr T&data_cast(
byte*p){
return*::std::launder(
reinterpret_cast<T*
>(p));}
1948 [[nodiscard]]
constexpr byte*cast_to_data(T*p){return ::std::launder(
reinterpret_cast<byte*
>(p));}
1954 [[nodiscard]]
constexpr const byte*cast_to_data(
const T*p){return ::std::launder(
reinterpret_cast<const byte*
>(p));}
1961 template<
class...Ts>
1963 push_and_disable_msvc_warning(4324);
1964 alignas(max({
alignof(Ts)...}))
1965 byte _data[max({
sizeof(Ts)...})];
1966 constexpr operator byte*(){
return _data;}
1990 [[nodiscard]]
constexpr bool full_equal_in_byte(
const T&a,
const T&b){
1991 return equal(cast_to_data(&a),cast_to_data(&b),
sizeof(T));
1996 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
1997 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/pointer.hpp"
2007 enable_adl(the_pointer_to_bool);
2010 template<
typename T>
2011 [[nodiscard]]
constexpr auto pointer_to_bool(T*a)
noexcept{
2012 if constexpr(was_not_an_ill_form(the_pointer_to_bool(a)))
2013 return the_pointer_to_bool(a);
2018 enable_adl(the_pointer_equal);
2021 template<
typename T>
2022 [[nodiscard]]
constexpr auto pointer_equal(T*a,T*b)
noexcept{
2023 if constexpr(was_not_an_ill_form(the_pointer_equal(a,b)))
2024 return the_pointer_equal(a,b);
2031 inline constexpr bool is_pointer= ::std::is_pointer_v<T>;
2033 typedef void*pointer;
2035 typedef const void*const_pointer;
2038 [[nodiscard]]
constexpr ptrdiff_t get_off_set(note::from_t<const_pointer>a,note::to_t<const_pointer>b)
noexcept{
2039 return cast_to_data(b())-cast_to_data(a());
2043 [[nodiscard]]
constexpr auto apply_off_set(T*a,ptrdiff_t c)
noexcept{
2044 return cast_to_data(a)+c;
2048 [[nodiscard]]
constexpr auto unapply_off_set(T*b,ptrdiff_t c)
noexcept{
2049 return cast_to_data(b)-c;
2054 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2055 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/hash.hpp"
2065 typedef size_t hash_base_t;
2068 constexpr hash_base_t operator%(
auto&&a)
const noexcept{
2071 constexpr bool operator==(
const hash_value_t&a)
const noexcept{
2072 return _value==a._value;
2082 inline constexpr bool is_fundamental_hash = ::std::is_fundamental_v<T>;
2084 enable_adl(the_pointer_hash);
2086 [[nodiscard]]
inline constexpr hash_value_t pointer_hash(T*a)
noexcept{
2087 if constexpr(was_not_an_ill_form(the_pointer_hash(a)))
2088 return the_pointer_hash(a);
2090 return{hash_base_t(a)};
2095 [[nodiscard]]
static constexpr inline bool nothrow_helper()
noexcept{
2096 if constexpr(is_pointer<T>)
2097 return noexcept(pointer_hash(declvalue(
const T&)));
2098 elseif
constexpr(is_fundamental_hash<T>)
2099 return noexcept(
hash_value_t{hash_base_t(declvalue(
const T&))});
2100 elseif
constexpr(is_unstable_hash<T>)
2102 elseif
constexpr(was_not_an_ill_form(declvalue(
const T&).hash()))
2103 return noexcept(declvalue(
const T&).hash());
2104 elseif
constexpr(was_not_an_ill_form(
hash_value_t(declvalue(
const T&))))
2106 elseif
constexpr(type_info<remove_cv<T>> == type_info<base_type_info_t>)
2112 static constexpr bool nothrow=nothrow_helper<T>();
2114 [[nodiscard]]
static constexpr inline bool able_helper()
noexcept{
2115 if constexpr(is_pointer<T>)
2117 elseif
constexpr(is_fundamental_hash<T>)
2119 elseif
constexpr(is_unstable_hash<T>)
2121 elseif
constexpr(was_not_an_ill_form(declvalue(
const T&).hash()))
2123 elseif
constexpr(was_not_an_ill_form(
hash_value_t(declvalue(
const T&))))
2125 elseif
constexpr(type_info<remove_cv<T>> == type_info<base_type_info_t>)
2131 static constexpr bool able=able_helper<T>();
2133 #define hash operator()
2135 [[nodiscard]]
inline constexpr hash_value_t hash(nothing)
const noexcept{
2136 return{hash_base_t(nothing)};
2139 return{a.get_hash()};
2141 template<
class T>
requires able<T>
2142 [[nodiscard]]constexpr_as_auto
inline auto hash(
const T&a)
const noexcept(nothrow<T>){
2144 if constexpr(is_pointer<T>)
2145 return pointer_hash(a);
2146 elseif
constexpr(is_fundamental_hash<T>)
2148 elseif
constexpr(is_unstable_hash<T>)
2150 elseif
constexpr(was_not_an_ill_form(declvalue(
const T&).hash()))
2152 elseif
constexpr(was_not_an_ill_form(
hash_value_t(declvalue(
const T&))))
2155 template_error(
"Please overload the function hash in the namespace where this type is defined.");
2158 #define hash operator()
2161 [[nodiscard]]constexpr_as_auto
inline hash_base_t get_hash_in_base_type(
const T&a)
const noexcept(nothrow<T>){
2162 return hash(a)._value;
2167 [[nodiscard]]force_inline
constexpr hash_value_t with_calculated_before(
hash_value_t before,
size_t before_size,
const T*a,
size_t size)
const noexcept{
2168 hash_base_t aret=before._value;
2169 rot_iterator<
decltype(aret)>rotl_offset = before_size+size;
2171 aret ^= rotl(get_hash_in_base_type(a[size]),rotl_offset);
2182 constexpr size_t bit_range_max=bitnum_of(hash_base_t);
2183 constexpr hash_base_t void_hash{nothing};
2184 suppress_msvc_warning(26475)
2185 constexpr hash_base_t npos_hash{hash_base_t(-1)};
2186 constexpr size_t bitnumof_void=bit_range_max*BIT_POSSIBILITY;
2188 size=size%bitnumof_void;
2189 if(value._value==0 || size==0)
2191 if(size >= bit_range_max){
2192 const bool is_npos = ::std::popcount(value._value)%BIT_POSSIBILITY;
2193 aret = is_npos?npos_hash:void_hash;
2194 size-=bit_range_max;
2201 aret ^= rotl(value._value,rotl_offset);
2208 [[nodiscard]]force_inline
constexpr hash_value_t repeat_times(T&&value,
size_t size)
const noexcept{
2209 return repeat_times(hash(value),size);
2212 [[nodiscard]]
constexpr inline hash_value_t hash(
const T*a,
size_t size)
const noexcept(nothrow<const T>){
2213 return with_calculated_before(hash(nothing),0,a,size);
2216 [[nodiscard]]force_inline
hash_value_t merge_array_hash_results(
2219 return{before._value^(rotl(after._value,before_size))};
2221 template<
class T>
requires is_not_signal_value_for_array_like<T>
2223 return hash(a.begin(),a.size());
2225 template<
class T>
requires is_not_signal_value_for_array_like<T>
2227 return with_calculated_before(before,before_size,a.begin(),a.size());
2236 using hash_n::is_unstable_hash;
2237 using hash_n::is_fundamental_hash;
2242 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2243 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/range.hpp"
2255 template<
typename T>
2259 constexpr range_t(
const T begin,
const T end):_begin(begin),_end(end){}
2265 constexpr size_t size()
noexcept{
return _end-_begin;}
2266 constexpr auto end()
noexcept{
return _end;}
2267 constexpr auto begin()
noexcept{
return _begin;}
2268 constexpr auto end()
const noexcept{
return _end;}
2269 constexpr auto begin()
const noexcept{
return _begin;}
2271 template <
class U>
requires(type_info<T>.can_convert_to<U>)
2272 constexpr operator range_t<U>()
const noexcept(type_info<T>.can_nothrow_convert_to<U>){
2273 return {_begin,_end};
2278 [[nodiscard]]
inline auto size_of_array_like(
range_t<T*>&a)
noexcept{
return a.size();}
2280 [[nodiscard]]
inline auto size_of_array_like(
range_t<const T*>&a)
noexcept{
return a.size();}
2283 [[nodiscard]]
inline auto begin_of_array_like(
range_t<T*>&a)
noexcept{
return a.begin();}
2285 [[nodiscard]]
inline auto begin_of_array_like(range_t<const T*>&a)
noexcept{
return a.begin();}
2289 template<
typename T>
2290 [[nodiscard]]
constexpr bool in_range(T pattern,
const range_t<T>range)noexcept_as(
bool(declvalue(T)>=declvalue(
const T) && declvalue(T)<=declvalue(
const T))){
2291 return bool(pattern>=range.begin() && pattern<range.end());
2295 template<
typename T>
2296 [[nodiscard]]
constexpr bool in_range(T*pattern,
const range_t<byte*>range)
noexcept{
2297 return cast_to_data(pattern)>=range.begin() && cast_to_data(pattern)<range.end();
2302 template<
typename T>
2305 typedef unsigned char index_type;
2307 size_t skip_table[number_of_possible_values_per<index_type>]{};
2308 size_t radical_skip_table[number_of_possible_values_per<index_type>]{};
2309 index_type pre_index_table[number_of_possible_values_per<index_type>]{};
2311 static constexpr index_type get_index_of(T&ch)
noexcept{
2312 return index_type(hash(ch) % number_of_possible_values_per<index_type>);
2315 const size_t m=pattern.size();
2318 for(
size_t i=0;i<number_of_possible_values_per<index_type>;i++){
2319 skip_table[i]=radical_skip_table[i]=m;
2321 skip_table[get_index_of(pattern[0])]=radical_skip_table[get_index_of(pattern[0])]=m-1;
2322 for(
size_t i=1;i<m-1;i++){
2323 index_type index=get_index_of(pattern[i]);
2324 radical_skip_table[index]=skip_table[index];
2325 skip_table[index]=m-i-1;
2326 pre_index_table[index]=get_index_of(pattern[i-1]);
2330 build_table(_pattern);
2333 size_t m = _pattern.size();
2335 return range.begin();
2336 size_t n= range.size();
2341 while((j>=0)&&(_pattern[j]==range[i])){
2345 return addressof(range[i+1]);
2346 index_type index_k=get_index_of(range[k]);
2347 if(get_index_of(range[k-1])!=pre_index_table[index_k])
2348 i=k+radical_skip_table[index_k];
2350 i=k+skip_table[index_k];
2358 template<
typename T>
2361 typedef unsigned char index_type;
2363 size_t skip_table[number_of_possible_values_per<index_type>]{};
2364 size_t radical_skip_table[number_of_possible_values_per<index_type>]{};
2365 index_type pre_index_table[number_of_possible_values_per<index_type>]{};
2367 static constexpr index_type get_index_of(T&ch)
noexcept{
2368 return index_type(hash(ch) % number_of_possible_values_per<index_type>);
2371 const size_t m=pattern.size();
2374 for(
size_t i=0;i<number_of_possible_values_per<index_type>;i++){
2375 skip_table[i]=radical_skip_table[i]=m;
2377 skip_table[get_index_of(pattern[m-1])]=radical_skip_table[get_index_of(pattern[m-1])]=m-1;
2378 for(ptrdiff_t i=m-2;i>=0;i--){
2379 index_type index=get_index_of(pattern[i]);
2380 radical_skip_table[index]=skip_table[index];
2381 skip_table[index]=i;
2382 pre_index_table[index]=get_index_of(pattern[i+1]);
2386 build_table(_pattern);
2389 size_t m=_pattern.size();
2391 return range.begin();
2392 size_t n= range.size();
2397 while((j<=m-1)&&(_pattern[j]==range[i])){
2401 return addressof(range[k]);
2402 index_type index_k=get_index_of(range[k]);
2403 if(get_index_of(range[k+1])!=pre_index_table[index_k])
2404 i=k-radical_skip_table[index_k];
2406 i=k-skip_table[index_k];
2411 suppress_msvc_warning(26475)
2414 static constexpr
size_t npos =
size_t(-1);
2416 template<typename T>
2418 for(
auto&i : range){
2420 return addressof(i);
2425 template<
typename T>
2427 auto result = in_range(pattern,range);
2429 return result - range.begin();
2435 template<
typename T>
2436 [[nodiscard]]
constexpr T* in_range(array_like_view_t<T>pattern,array_like_view_t<T>range){
2437 if(range.size() >= 512 && pattern.size() >= 11){
2438 match_pattern tmp=pattern;
2439 return tmp.match(range);
2443 size_t matching_off_set=1;
2447 while(pattern.end()[0-matching_off_set]==range.begin()[off_set+pattern.size()-matching_off_set])
2448 if(matching_off_set==pattern.size())
2449 return addressof(range.begin()[off_set]);
2452 if(off_set+pattern.size() >= range.size())
2454 auto tmp = in_range(range.begin()[off_set+pattern.size()], pattern);
2456 tmp=pattern.begin();
2457 off_set+=pattern.end()-tmp;
2461 template<
typename T>
2462 [[nodiscard]]
constexpr size_t in_range_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2463 auto result = in_range(pattern,range);
2465 return result - range.begin();
2470 template<
typename T>
2471 [[nodiscard]]
constexpr T* in_range_but_reverse(T&pattern,array_like_view_t<T>range){
2472 for(
auto&i : range|::std::views::reverse){
2474 return addressof(i);
2479 template<
typename T>
2480 [[nodiscard]]
constexpr size_t in_range_but_reverse_size_t(T&pattern,array_like_view_t<T>range){
2481 auto result = in_range_but_reverse(pattern,range);
2483 return result - range.begin();
2489 template<
typename T>
2490 [[nodiscard]]
constexpr T* in_range_but_reverse(array_like_view_t<T>pattern,array_like_view_t<T>range){
2491 if(range.size() >= 512 && pattern.size() >= 11){
2492 reverse_match_pattern tmp = pattern;
2493 return tmp.match(range);
2497 size_t matching_off_set=0;
2501 while(pattern.begin()[matching_off_set]==range.end()[0-(off_set+pattern.size()-matching_off_set)])
2502 if(matching_off_set==pattern.size()-1)
2503 return addressof(range.end()[0-(off_set+pattern.size())]);
2506 if(off_set+pattern.size() >= range.size())
2508 auto tmp = in_range_but_reverse(range.end()[0-(off_set+pattern.size()+1)], pattern);
2510 tmp=pattern.end()-1;
2511 off_set+=tmp-pattern.begin();
2516 template<
typename T>
2517 [[nodiscard]]
constexpr size_t in_range_but_reverse_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2518 auto result = in_range_but_reverse(pattern,range);
2520 return result - range.begin();
2528 template<
typename T>
2530 typedef unsigned char index_type;
2531 bool _bitmark[number_of_possible_values_per<index_type>]{};
2535 if constexpr(number_of_possible_values_per<T> > number_of_possible_values_per<index_type>){
2536 for(
auto& i: pattern){
2537 if(::std::make_unsigned_t<T>(i) >= number_of_possible_values_per<index_type>)
2539 _bitmark[index_type(i)] =
true;
2543 for(
auto& i: pattern)
2544 _bitmark[index_type(i)] =
true;
2548 [[nodiscard]]
constexpr bool operator[](T&index)
const noexcept{
2549 if constexpr(number_of_possible_values_per<T> > number_of_possible_values_per<index_type>)
2550 if(::std::make_unsigned_t<T>(index) >= number_of_possible_values_per<index_type>)
2552 return _bitmark[index_type(index)];
2557 template<
typename T>
2559 for(
auto&i : range){
2561 return addressof(i);
2567 template<
typename T>
2569 for(
auto&i : range){
2570 if(in_range(i,pattern))
2571 return addressof(i);
2577 template<
typename T>
2578 [[nodiscard]]
constexpr T* find_first_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2579 if constexpr(::std::is_integral_v<T>){
2580 bitmark_for_finds<T> mark;
2581 if(mark.mark(pattern))
2582 return find_first_of_bitmark(mark,range);
2584 return base_find_first_of(pattern,range);
2587 template<
typename T>
2588 [[nodiscard]]
constexpr size_t find_first_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2589 auto result = find_first_of(pattern,range);
2591 return result - range.begin();
2597 template<
typename T>
2598 [[nodiscard]]
constexpr T* find_last_of_bitmark(
const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2599 for(
auto& i: range|::std::views::reverse){
2601 return addressof(i);
2606 template<
typename T>
2607 [[nodiscard]]
constexpr T* base_find_last_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2608 for(
auto&i : range|::std::views::reverse){
2609 if(in_range(i,pattern))
2610 return addressof(i);
2616 template<
typename T>
2617 [[nodiscard]]
constexpr T* find_last_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2618 if constexpr(::std::is_integral_v<T>){
2619 bitmark_for_finds<T> mark;
2620 if(mark.mark(pattern))
2621 return find_last_of_bitmark(mark,range);
2623 return base_find_last_of(pattern,range);
2626 template<
typename T>
2627 [[nodiscard]]
constexpr size_t find_last_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2628 auto result = find_last_of(pattern,range);
2630 return result - range.begin();
2636 template<
typename T>
2637 [[nodiscard]]
constexpr T* find_first_not_of_bitmark(
const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2638 for(
auto& i: range){
2640 return addressof(i);
2646 template<
typename T>
2647 [[nodiscard]]
constexpr T* base_find_first_not_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2648 for(
auto&i : range){
2649 if(!in_range(i,pattern))
2650 return addressof(i);
2656 template<
typename T>
2657 [[nodiscard]]
constexpr T* find_first_not_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2658 if constexpr(::std::is_integral_v<T>){
2659 bitmark_for_finds<T> mark;
2660 if(mark.mark(pattern))
2661 return find_first_not_of_bitmark(mark,range);
2663 return base_find_first_not_of(pattern,range);
2666 template<
typename T>
2667 [[nodiscard]]
constexpr size_t find_first_not_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2668 auto result = find_first_not_of(pattern,range);
2670 return result - range.begin();
2676 template<
typename T>
2677 [[nodiscard]]
constexpr T* find_last_not_of_bitmark(
const bitmark_for_finds<T>&mark,array_like_view_t<T>range){
2678 for(
auto& i: range|::std::views::reverse){
2680 return addressof(i);
2686 template<
typename T>
2687 [[nodiscard]]
constexpr T* base_find_last_not_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2688 for(
auto&i : range|::std::views::reverse){
2689 if(!in_range(i,pattern))
2690 return addressof(i);
2696 template<
typename T>
2697 [[nodiscard]]
constexpr T* find_last_not_of(array_like_view_t<T>pattern,array_like_view_t<T>range){
2698 if constexpr(::std::is_integral_v<T>){
2699 bitmark_for_finds<T> mark;
2700 if(mark.mark(pattern))
2701 return find_last_not_of_bitmark(mark,range);
2703 return base_find_last_not_of(pattern,range);
2706 template<
typename T>
2707 [[nodiscard]]
constexpr size_t find_last_not_of_size_t(array_like_view_t<T>pattern,array_like_view_t<T>range){
2708 auto result = find_last_not_of(pattern,range);
2710 return result - range.begin();
2715 using range_n::range_t;
2716 using range_n::in_range;
2717 using range_n::in_range_size_t;
2718 using range_n::in_range_but_reverse;
2719 using range_n::in_range_but_reverse_size_t;
2720 using range_n::find_first_of;
2721 using range_n::find_last_of;
2722 using range_n::find_first_not_of;
2723 using range_n::find_last_not_of;
2727 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2728 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/string_view.hpp"
2738 namespace constexpr_str_n {
2739 template<
typename char_T>
2740 struct constexpr_str_t;
2742 using constexpr_str_n::constexpr_str_t;
2746 template<
typename T>
2747 [[nodiscard]]
constexpr T* in_range(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2749 template<
typename T>
2750 [[nodiscard]]
constexpr size_t in_range_size_t(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2751 auto result = in_range(pattern, range);
2753 return result - range.data();
2757 template<
typename T>
2758 [[nodiscard]]
constexpr T* in_range_but_reverse(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2760 template<
typename T>
2761 [[nodiscard]]
constexpr size_t in_range_but_reverse_size_t(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2762 auto result = in_range_but_reverse(pattern, range);
2764 return result - range.data();
2768 template<
typename T>
2769 [[nodiscard]]
constexpr T* find_first_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2771 template<
typename T>
2772 [[nodiscard]]
constexpr size_t find_first_of_size_t(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2773 auto result = find_first_of(pattern, range);
2775 return result - range.data();
2779 template<
typename T>
2780 [[nodiscard]]
constexpr T* find_last_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2782 template<
typename T>
2783 [[nodiscard]]
constexpr size_t find_last_of_size_t(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2784 auto result = find_last_of(pattern, range);
2786 return result - range.data();
2790 template<
typename T>
2791 [[nodiscard]]
constexpr T* find_first_not_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2793 template<
typename T>
2794 [[nodiscard]]
constexpr size_t find_first_not_of_size_t(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2795 auto result = find_first_not_of(pattern, range);
2797 return result - range.data();
2801 template<
typename T>
2802 [[nodiscard]]
constexpr T* find_last_not_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range);
2804 template<
typename T>
2805 [[nodiscard]]
constexpr T* find_last_not_of_size_t(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
2806 auto result = find_last_not_of(pattern,range);
2808 return result - range.begin();
2814 namespace string_view_n{
2816 template<
typename char_T>
2818 static constexpr size_t npos=range_n::npos;
2821 using base_t::base_t;
2824 [[nodiscard]]
constexpr const char_T*str()
const noexcept{
return base_t::cbegin();}
2825 [[nodiscard]]
constexpr const char_T*data()
const noexcept{
return base_t::cbegin();}
2826 [[nodiscard]]
constexpr operator const char_T*()
const noexcept{
return str();}
2828 [[nodiscard]]
constexpr string_view_t substr(
size_t pos,
size_t len)
const noexcept{
2831 [[nodiscard]]
constexpr string_view_t substr(
size_t pos)
const noexcept{
2832 return string_view_t(base_t::cbegin()+pos,base_t::size()-pos);
2834 [[nodiscard]]
constexpr string_view_t substr(
size_t pos,
const char_T*end)
const noexcept{
2835 return string_view_t(base_t::cbegin()+pos,end-base_t::cbegin());
2837 [[nodiscard]]
constexpr string_view_t substr(
const char_T*begin,
size_t len)
const noexcept{
2840 [[nodiscard]]
constexpr string_view_t substr(
const char_T*begin)
const noexcept{
2843 [[nodiscard]]
constexpr string_view_t substr(
const char_T*begin,
const char_T*end)
const noexcept{
2847 [[nodiscard]]
constexpr size_t find(
const char_T ch)
const{
2848 return in_range_size_t(ch, *
this);
2850 [[nodiscard]]
constexpr size_t reverse_find(
const char_T ch)
const{
2851 return in_range_but_reverse_size_t(ch, *
this);
2854 return in_range_size_t(str, *
this);
2856 [[nodiscard]]
constexpr size_t reverse_find(
string_view_t str)
const{
2857 return in_range_but_reverse_size_t(str, *
this);
2860 return in_range_size_t(str, *
this);
2863 return in_range_but_reverse_size_t(str, *
this);
2866 [[nodiscard]]
constexpr size_t find_first_of(
const char_T ch)
const{
2867 return range_n::find_first_of_size_t(ch, *
this);
2869 [[nodiscard]]
constexpr size_t find_last_of(
const char_T ch)
const{
2870 return range_n::find_last_of_size_t(ch, *
this);
2872 [[nodiscard]]
constexpr size_t find_first_not_of(
const char_T ch)
const{
2873 return range_n::find_first_not_of_size_t(ch, *
this);
2875 [[nodiscard]]
constexpr size_t find_last_not_of(
const char_T ch)
const{
2876 return range_n::find_last_not_of_size_t(ch, *
this);
2878 [[nodiscard]]
constexpr size_t find_first_of(
string_view_t str)
const{
2879 return range_n::find_first_of_size_t(str, *
this);
2881 [[nodiscard]]
constexpr size_t find_last_of(
string_view_t str)
const{
2882 return range_n::find_last_of_size_t(str, *
this);
2884 [[nodiscard]]
constexpr size_t find_first_not_of(
string_view_t str)
const{
2885 return range_n::find_first_not_of_size_t(str, *
this);
2887 [[nodiscard]]
constexpr size_t find_last_not_of(
string_view_t str)
const{
2888 return range_n::find_last_not_of_size_t(str, *
this);
2891 return range_n::find_first_of_size_t(str, *
this);
2894 return range_n::find_last_of_size_t(str, *
this);
2897 return range_n::find_first_not_of_size_t(str, *
this);
2900 return range_n::find_last_not_of_size_t(str, *
this);
2910 #line 32 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2911 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/type_name.hpp"
2926 static base_t demangle(
const char*original_name)
noexcept{
2927 push_and_disable_msvc_warning(26494);
2929 const char*demangled_name;
2931 #if defined(__clang__)||defined(__GNUC__)
2935 demangled_name=::abi::__cxa_demangle(original_name,
nullptr,&len,&status);
2937 demangled_name=original_name;
2938 len=::std::strlen(original_name);
2939 ::std::free((
void*)demangled_name);
2944 demangled_name=original_name;
2945 len=::std::strlen(original_name);
2947 return base_t{demangled_name,len};
2950 static base_t copy_demangle(
base_t demangled_name)
noexcept{
2951 #if defined(__clang__)||defined(__GNUC__)
2954 char*copyed_name=(
char*)::std::malloc(demangled_name.size()+1);
2955 if(copyed_name==
nullptr)
2956 return base_t{
nullptr,0};
2957 ::std::memcpy(copyed_name,demangled_name.data(),demangled_name.size());
2958 copyed_name[demangled_name.size()]=
'\0';
2959 return base_t{copyed_name,demangled_name.size()};
2963 return demangled_name;
2976 #if defined(__clang__)||defined(__GNUC__)
2979 ::std::free((
void*)begin());
2983 [[nodiscard]]
inline type_name_t base_type_info_t::get_name()const noexcept{
2984 return _tid.get_name();
2986 [[nodiscard]]
inline type_name_t base_type_info_t::type_id_t::get_name()const noexcept{
2989 template<
typename T>
2990 [[nodiscard]]
inline type_name_t type_info_t<T>::get_name()const noexcept{
2991 return base_type_info_t(*this).get_name();
2996 #line 33 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
2997 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/constexpr_str.hpp"
3006 namespace constexpr_str_n{
3008 template<
typename char_T>
3014 [[nodiscard]]
constexpr const char_T*str()
const noexcept{
return base_t::cbegin();}
3015 [[nodiscard]]
constexpr const char_T*data()
const noexcept{
return base_t::cbegin();}
3016 [[nodiscard]]
constexpr operator const char_T*()
const noexcept{
return str();}
3019 return base_t::substr(pos,len);
3022 return base_t::substr(pos);
3025 return base_t::substr(pos,end);
3027 [[nodiscard]]
constexpr constexpr_str_view_t substr(
const char_T*begin,
size_t len)
const noexcept{
3028 return base_t::substr(begin,len);
3031 return base_t::substr(begin);
3033 [[nodiscard]]
constexpr constexpr_str_view_t substr(
const char_T*begin,
const char_T*end)
const noexcept{
3034 return base_t::substr(begin,end);
3038 template<
typename char_T>
3045 bool is_bitmark_workable;
3048 hash_result(defs::hash(str, size)),
3051 is_bitmark_workable = bitmark_for_finds.mark(*
this);
3054 [[nodiscard]]
constexpr hash_t hash()
const noexcept{
return hash_result;}
3056 template<
class char_T,
size_t N>
3058 const char_T* _array_begin;
3062 [[nodiscard]]
constexpr auto get_constexpr_str_t()
const noexcept{
3066 template<constexpr_str_t_literal_helper v>
3068 distinctive
static constexpr auto value = v.get_constexpr_str_t();
3072 template<constexpr_str_t_literal_helper str_helper>
3073 [[nodiscard]]
inline consteval auto&
operator ""_constexpr_str()noexcept{
3077 template<
class char_T>
3078 distinctive
inline constexpr auto empty_constexpr_str_of =
constexpr_str_t(&const_default_value_of<char_T>,0);
3082 using constexpr_str_n::empty_constexpr_str_of;
3083 using constexpr_str_n::operator
""_constexpr_str;
3087 template<
typename T>
3089 return pattern.match_pattern.match(range);
3091 template<
typename T>
3092 [[nodiscard]]
constexpr T* in_range_but_reverse(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3093 return pattern.reverse_match_pattern.match(range);
3097 template<
typename T>
3098 [[nodiscard]]
constexpr T* find_first_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3099 if(pattern.is_bitmark_workable){
3100 return find_first_of_bitmark(pattern.bitmark_for_finds,range);
3103 return find_first_of((
const constexpr_str_view_t<T>&)pattern,range);
3108 template<
typename T>
3109 [[nodiscard]]
constexpr T* find_last_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3110 if(pattern.is_bitmark_workable){
3111 return find_last_of_bitmark(pattern.bitmark_for_finds,range);
3114 return find_last_of((
const constexpr_str_view_t<T>&)pattern,range);
3119 template<
typename T>
3120 [[nodiscard]]
constexpr T* find_first_not_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3121 if(pattern.is_bitmark_workable){
3122 return find_first_not_of_bitmark(pattern.bitmark_for_finds,range);
3125 return find_first_not_of((
const constexpr_str_view_t<T>&)pattern,range);
3130 template<
typename T>
3131 [[nodiscard]]
constexpr T* find_last_not_of(
const constexpr_str_t<T>&pattern,array_like_view_t<T>range){
3132 if(pattern.is_bitmark_workable){
3133 return find_last_not_of_bitmark(pattern.bitmark_for_finds,range);
3136 return find_last_not_of((
const constexpr_str_view_t<T>&)pattern,range);
3143 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3144 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/logical_bool.hpp"
3172 [[no_unique_address]]
bool _is_true;
3173 [[no_unique_address]]
bool _is_false;
3174 [[no_unique_address]]
bool _is_unknown;
3176 constexpr logical_bool(
special_init_t,
bool is_true,
bool is_false,
bool is_unknown=0):_is_true(is_true),_is_false(is_false),_is_unknown(is_unknown){}
3177 constexpr logical_bool(
bool a):_is_true(a),_is_false(!a),_is_unknown(0){}
3180 constexpr explicit operator bool()
const{
return _is_true && !_is_unknown;}
3183 swap(aret._is_true,aret._is_false);
3187 return logical_bool{special_init,a._is_true && b._is_true,a._is_false || b._is_false,a._is_unknown || b._is_unknown};
3190 return logical_bool{special_init,a._is_true || b._is_true,a._is_false && b._is_false,a._is_unknown || b._is_unknown};
3193 logical_bool aret(a._is_true == b._is_true && a._is_false == b._is_false);
3194 aret._is_unknown = a._is_unknown || b._is_unknown;
3198 constexpr logical_bool neither{special_init,0,0},either{special_init,1,1},unknown{special_init,0,0,1};
3202 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3203 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/zero.hpp"
3216 template<
class T>
requires(type_info<
decltype(0)>.can_convert_to<T>)
3217 operator T()
const noexcept(type_info<
decltype(0)>.can_nothrow_convert_to<T>){
return 0;}
3221 constexpr inline bool is_all_byte_zero(T&&a){
3222 const byte*ptr=cast_to_data(addressof(a));
3223 const byte*end=ptr+
sizeof(a);
3225 if((
unsigned char)(*ptr++))
3232 #line 36 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3233 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/count_able.hpp"
3243 [[nodiscard]]
inline size_t the_number_of(type_info_t<T>)
noexcept;
3248 static size_t _number;
3254 [[nodiscard]]
inline size_t the_number_of(
type_info_t<T>)
noexcept{
3255 if constexpr(type_info<T>.not_has_attribute(
count_able))
3256 template_error(
"hey.");
3262 #line 37 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3263 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/invoke.hpp"
3272 template<
typename T>
3274 template<
class...Args>
3275 static constexpr bool able= ::std::is_invocable_v<T,Args...>;
3276 template<
class...Args>
3277 static constexpr bool nothrow= ::std::is_nothrow_invocable_v<T,Args...>;
3279 template<
class...Args>
requires able<Args...>
3280 auto _as(Args&&...rest)
const noexcept(nothrow<Args...>){
3281 return lambda_with_catch(rest...)(
const T&a)
noexcept(nothrow<Args...>){
return a(forward<Args>(rest)...);};
3284 template<
typename T>
3289 #line 38 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3290 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/maybe_fail_reference.hpp"
3299 template<
typename T>
3307 [[nodiscard]]
bool not_fail()
noexcept{
return _ref_to;}
3308 [[nodiscard]]
bool fail()
noexcept{
return!not_fail();}
3309 T&get_ref()
noexcept{
return*_ref_to;}
3314 #line 39 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/base_defs/_body.hpp"
3318 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
3322 #if defined(_VCRUNTIME_H)
3323 using base::type_info;
3326 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
3334 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
3345 #if defined(_MSC_VER)
3346 #pragma warning(pop)
3348 #undef suppress_msvc_warning
3349 #undef disable_msvc_warning
3350 #undef push_msvc_warning
3351 #undef pop_msvc_warning
3352 #undef push_and_disable_msvc_warning
3355 #undef BIT_POSSIBILITY
3357 #if defined(ELC_VOID_NAME)
3358 #define void the_void
3363 #undef noexcept_as_auto
3365 #undef constexpr_as_auto
3367 #undef using_method_from_base_t
3368 #undef using_method_from_value
3378 #undef template_error
3379 #undef template_warning
3384 #undef is_common_attribute
3385 #undef is_special_attribute
3387 #undef has_attribute
3388 #undef not_has_attribute
3390 #undef float_size_of
3393 #undef def_common_attribute_with_nothing
3394 #undef def_special_attribute_with_nothing
3396 #undef common_attribute_t
3397 #undef special_attribute_t
3400 #undef enabled_by_default
3401 #undef disabled_by_default
3402 #undef enable_if_not_ill_form
3405 #undef was_an_ill_form
3406 #undef was_an_ill_form_with_parameter
3407 #undef was_not_an_ill_form
3408 #undef was_not_an_ill_form_and_noexcept
3409 #undef was_not_an_ill_form_with_parameter
3411 #undef recursive_lambda
3412 #undef get_recursive_lambda_caller
3414 #undef lambda_with_catch
3415 #undef self_recursion
3416 #undef lambda_RLSRRS
3426 #if defined(_MSC_VER)
3432 #undef INTER_NAMESPACE
3433 #undef BREAK_NAMESPACE
3438 #undef template_name
3446 #undef ELC_TEST_EVENTNAME
3448 #undef override_instance_struct
3454 #undef with_no_vtable
3458 #undef no_vtable_struct
3459 #undef no_vtable_class
3463 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
3467 #line 38 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_defs/_body.hpp"
3472 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
3477 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
3480 #if defined(ELC_TEST_ON)
3483 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
3492 #if defined(ELC_TEST)
3493 #error "this part cannot be tested."
3498 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3511 #if !defined(ELC_APIS_alloc)
3512 #define ELC_APIS_alloc
3513 #if defined(ELC_MEMORY_ALLOC_LOCATION_RECORD)
3514 #include <stacktrace>
3516 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/decl_system_type.hpp"
3528 #if defined(__linux)||defined(__linux__)||defined(__gnu_linux__)
3529 #define SYSTEM_TYPE linux
3530 #elif defined(_WIN32)||defined(__MINGW32__)||defined(__CYGWIN__)
3531 #define SYSTEM_TYPE windows
3533 #define SYSTEM_TYPE other
3535 #define ERROR_MSG_UNABLE_OS "Unable OS,edit this file on your own or contact ELC's producers."
3539 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3540 #if SYSTEM_TYPE == windows
3549 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
3558 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
3562 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3563 namespace elc::APIs::alloc{
3564 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
3576 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
3578 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
3589 #define BIT_POSSIBILITY 2
3593 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
3595 #if defined(_MSC_VER)
3596 #pragma warning(push,ELC_WARNING_LEVEL)
3597 #pragma warning(disable:4099)
3598 #pragma warning(disable:26812)
3599 #pragma warning(disable:4584)
3600 #pragma warning(disable:4250)
3601 #pragma warning(disable:26432)
3602 #pragma warning(disable:26435)
3603 #pragma warning(disable:26481)
3604 #pragma warning(disable:26446)
3605 #pragma warning(disable:26434)
3606 #pragma warning(disable:26429)
3607 #pragma warning(disable:26471)
3608 #pragma warning(disable:26474)
3609 #pragma warning(disable:26473)
3610 #pragma warning(disable:26456)
3611 #pragma warning(disable:26485)
3612 #pragma warning(disable:26490)
3613 #pragma warning(disable:26472)
3614 #pragma warning(disable:26482)
3615 #pragma warning(disable:26493)
3617 #if defined(_MSC_VER)
3618 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
3619 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
3620 #define push_msvc_warning() __pragma(warning(push))
3621 #define pop_msvc_warning() __pragma(warning(pop))
3622 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
3624 #define suppress_msvc_warning(...)
3625 #define disable_msvc_warning(...)
3626 #define push_msvc_warning()
3627 #define pop_msvc_warning()
3628 #define push_and_disable_msvc_warning(...)
3631 #if defined(ELC_VOID_NAME)
3636 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
3637 #define noexcept_as_auto MAGIC
3638 #define constexpr_as(...) MAGIC constexpr
3639 #define constexpr_as_auto MAGIC MAGIC constexpr
3641 #define using_method_from_base_t(name,...) \
3642 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
3643 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
3645 return base_t::name(forward<Args>(rest)...);\
3648 #define using_method_from_value(name,value_name,...) \
3649 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
3650 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
3652 return value_name.name(forward<Args>(rest)...);\
3655 #define floop while(__builtin_is_my_dick_still_there())
3656 #define enable_adl(name) void name()noexcept=delete
3658 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
3659 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
3661 #define declvalue(...) (::std::declval<__VA_ARGS__>())
3664 #define template_error(reason) static_assert(template_error_helper<T>,reason)
3666 #define template_warning(reason) template_warning_helper<T>(reason)
3669 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
3670 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
3672 #define is_common_attribute(name) public attribute<T,name<T>>
3673 #define is_special_attribute(name) public attribute<T,name>
3675 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
3676 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
3679 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
3681 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
3684 #define def_common_attribute_with_nothing(name) \
3685 template<typename T>\
3688 #define def_special_attribute_with_nothing(name) \
3691 #define common_attribute_t template<class>class
3692 #define special_attribute_t class
3702 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
3704 #define enabled_by_default class enable_state=void
3706 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
3708 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
3710 #define enable_flag class enable_state
3712 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
3713 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
3714 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
3715 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
3716 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
3719 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
3721 #define get_recursive_lambda_caller(name) \
3722 lambda_with_catch(&)(auto&&...Args){\
3723 return name(name,Args...);\
3728 #define lambda_with_catch(...) [__VA_ARGS__]
3730 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
3732 #define lambda_RLSRRS _my_jb_super_sb_name_
3740 #define elseif else if
3742 #define _big_than_ >
3744 #define _small_than_ <
3746 #if defined(_MSC_VER)
3753 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
3755 #define BREAK_NAMESPACE }
3758 #define template_name template
3760 #define type_name class
3762 #if defined(DEBUG) || defined(_DEBUG)
3763 #define not_in_debug 0
3765 #define not_in_debug 1
3769 #define ec(ch) U ## ch
3771 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
3772 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
3774 #define ELC_TEST_EVENTNAME(name)
3777 #define override_instance_struct \
3779 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
3780 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
3781 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
3782 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
3783 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
3786 #define distinctive __declspec(dllexport)
3792 #define force_inline __forceinline
3793 #elif defined(__GNUC__)
3794 #define force_inline __attribute__((always_inline)) inline
3796 #define force_inline inline
3800 #define with_no_vtable __declspec(novtable)
3802 #define with_no_vtable
3805 #define in_consteval (::std::is_constant_evaluated())
3807 #define no_vtable_struct struct with_no_vtable
3808 #define no_vtable_class class with_no_vtable
3812 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3814 using namespace ::elc::defs;
3815 #if SYSTEM_TYPE != windows
3817 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc/default_method/overhead.hpp"
3826 namespace overhead_n{
3827 using namespace ::elc::defs;
3828 constexpr size_t overhead_get_align(
size_t align){
3829 return max(align,
alignof(
size_t));
3831 constexpr size_t overhead_get_offset_value(
size_t align){
3832 align=overhead_get_align(align);
3833 return (
size_t(
sizeof(
size_t)/align)+
bool(
sizeof(
size_t)%align))*align;
3836 constexpr size_t correct_size(
size_t size,
size_t align){
3837 return size+overhead_get_offset_value(align);
3839 constexpr size_t correct_align(
size_t align){
3840 return overhead_get_align(align);
3842 inline pointer correct_pointer(pointer a,
size_t align){
3843 return apply_off_set(a,overhead_get_offset_value(align));
3845 inline pointer recorrect_pointer(pointer a,
size_t align){
3846 return unapply_off_set(a,overhead_get_offset_value(align));
3848 inline const_pointer recorrect_pointer(const_pointer a,
size_t align){
3849 return unapply_off_set(a,overhead_get_offset_value(align));
3851 inline void set_overhead(pointer a,
size_t size){
3852 *
reinterpret_cast<size_t*
>(a)=size;
3854 inline size_t get_overhead(const_pointer a){
3855 return*
reinterpret_cast<const size_t*
>(a);
3861 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3864 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc/debug_info/source_location_guard.hpp"
3873 #if defined(_MSC_VER)
3874 #if defined(ELC_MEMORY_ALLOC_LOCATION_RECORD)
3875 #pragma detect_mismatch("ELC_MEMORY_ALLOC_LOCATION_RECORD","true")
3877 #pragma detect_mismatch("ELC_MEMORY_ALLOC_LOCATION_RECORD","false")
3880 #if defined(ELC_MEMORY_ALLOC_LOCATION_RECORD)
3881 distinctive inline ::std::stacktrace_entry operate_source_frame;
3882 distinctive
inline struct source_location_info_t{
3883 const char*_file=
nullptr;
3884 uint_least32_t _line=0;
3885 const char*file()noexcept{
3888 static ::std::string file_cache;
3889 file_cache=operate_source_frame.source_file();
3890 _file=file_cache.c_str();
3897 uint_least32_t line()noexcept{
3900 _line=operate_source_frame.source_line();
3907 void clear()noexcept{
3911 }operate_source_location;
3912 struct source_location_guard{
3914 source_location_guard(
size_t lookup=0)noexcept{
3915 if(!operate_source_frame){
3916 ::std::stacktrace stack = ::std::stacktrace::current(lookup+2,1);
3918 operate_source_frame = stack[0];
3923 ~source_location_guard()noexcept{
3925 operate_source_frame = ::std::stacktrace_entry{};
3926 operate_source_location.clear();
3935 constexpr const char*file()
noexcept{
return nullptr;}
3936 constexpr uint_least32_t line()
noexcept{
return 0;}
3937 }operate_source_location;
3942 #line 36 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
3945 #if defined(_MSC_VER)
3946 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
3947 #pragma detect_mismatch("ELC_TEST_COUNT_MEMORY_ALLOC","true")
3949 #pragma detect_mismatch("ELC_TEST_COUNT_MEMORY_ALLOC","false")
3953 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
3954 [[nodiscard]]
inline size_t get_size_of_alloc(
const byte*p,
size_t align)
noexcept;
3955 namespace count_info{
3956 distinctive
inline size_t alloc_count=0;
3957 distinctive
inline size_t free_count=0;
3958 distinctive
inline size_t alloc_size=0;
3959 distinctive
inline size_t free_size=0;
3960 distinctive
inline size_t memory_using=0;
3961 distinctive
inline size_t memory_using_max=0;
3962 inline void update_memory_using(ptrdiff_t diff)
noexcept{
3964 if(memory_using>memory_using_max)
3965 memory_using_max=memory_using;
3967 inline void clear()noexcept{
3984 [[nodiscard]]
inline byte*aligned_alloc(
size_t align,
size_t size)
noexcept{
3987 #if SYSTEM_TYPE == windows
3989 aret = _aligned_malloc_dbg(size,align,operate_source_location.file(),operate_source_location.line());
3991 aret = _aligned_malloc(size,align);
3994 using namespace overhead_n;
3995 void*tmp=::std::aligned_alloc(correct_align(align),correct_size(size,align));
3997 set_overhead(tmp,size);
3998 aret = correct_pointer(tmp,align);
4004 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4006 count_info::alloc_count++;
4007 count_info::alloc_size+=size;
4008 count_info::update_memory_using(size);
4021 [[nodiscard]]
inline byte*realloc(
byte*ptr,
size_t nsize,[[maybe_unused]]
size_t align)
noexcept{
4022 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4023 const auto osize=get_size_of_alloc(ptr,align);
4027 #if SYSTEM_TYPE == windows
4029 aret = _aligned_realloc_dbg(ptr,nsize,align,operate_source_location.file(),operate_source_location.line());
4031 aret = _aligned_realloc(ptr,nsize,align);
4034 using namespace overhead_n;
4035 void*tmp=::std::realloc(recorrect_pointer(ptr,align),correct_size(nsize,align));
4037 set_overhead(tmp,nsize);
4038 aret = correct_pointer(tmp,align);
4044 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4046 count_info::alloc_size+=nsize-osize;
4047 count_info::update_memory_using(nsize-osize);
4057 inline void free(
byte*p,[[maybe_unused]]
size_t align)
noexcept{
4058 #if defined(ELC_TEST_COUNT_MEMORY_ALLOC)
4059 const auto size=get_size_of_alloc(p,align);
4060 count_info::free_count++;
4061 count_info::free_size+=size;
4062 count_info::update_memory_using(-ptrdiff_t(size));
4065 #if SYSTEM_TYPE == windows
4067 _aligned_free_dbg(p);
4072 using namespace overhead_n;
4073 ::std::free(recorrect_pointer(p,align));
4080 [[nodiscard]]
inline size_t get_size_of_alloc(
const byte*p,[[maybe_unused]]
size_t align)
noexcept{
4081 #if SYSTEM_TYPE == windows
4083 return _aligned_msize_dbg(remove_const(p),align,0);
4085 return _aligned_msize(remove_const(p),align,0);
4088 using namespace overhead_n;
4089 return get_overhead(recorrect_pointer(p,align));
4093 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
4104 #if defined(_MSC_VER)
4105 #pragma warning(pop)
4107 #undef suppress_msvc_warning
4108 #undef disable_msvc_warning
4109 #undef push_msvc_warning
4110 #undef pop_msvc_warning
4111 #undef push_and_disable_msvc_warning
4114 #undef BIT_POSSIBILITY
4116 #if defined(ELC_VOID_NAME)
4117 #define void the_void
4122 #undef noexcept_as_auto
4124 #undef constexpr_as_auto
4126 #undef using_method_from_base_t
4127 #undef using_method_from_value
4137 #undef template_error
4138 #undef template_warning
4143 #undef is_common_attribute
4144 #undef is_special_attribute
4146 #undef has_attribute
4147 #undef not_has_attribute
4149 #undef float_size_of
4152 #undef def_common_attribute_with_nothing
4153 #undef def_special_attribute_with_nothing
4155 #undef common_attribute_t
4156 #undef special_attribute_t
4159 #undef enabled_by_default
4160 #undef disabled_by_default
4161 #undef enable_if_not_ill_form
4164 #undef was_an_ill_form
4165 #undef was_an_ill_form_with_parameter
4166 #undef was_not_an_ill_form
4167 #undef was_not_an_ill_form_and_noexcept
4168 #undef was_not_an_ill_form_with_parameter
4170 #undef recursive_lambda
4171 #undef get_recursive_lambda_caller
4173 #undef lambda_with_catch
4174 #undef self_recursion
4175 #undef lambda_RLSRRS
4185 #if defined(_MSC_VER)
4191 #undef INTER_NAMESPACE
4192 #undef BREAK_NAMESPACE
4197 #undef template_name
4205 #undef ELC_TEST_EVENTNAME
4207 #undef override_instance_struct
4213 #undef with_no_vtable
4217 #undef no_vtable_struct
4218 #undef no_vtable_class
4222 #line 187 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
4225 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/undef_decl_system_type.hpp"
4238 #undef ERROR_MSG_UNABLE_OS
4242 #line 190 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/alloc.hpp"
4247 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
4249 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4262 #if !defined(ELC_APIS_die)
4263 #define ELC_APIS_die
4266 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
4276 typedef char32_t char_t;
4278 typedef int64_t int_t;
4280 typedef uint64_t uint_t;
4282 typedef double float_t;
4284 typedef long double float_size_t;
4289 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4290 namespace elc::APIs::die{
4291 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4303 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4305 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
4316 #define BIT_POSSIBILITY 2
4320 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4322 #if defined(_MSC_VER)
4323 #pragma warning(push,ELC_WARNING_LEVEL)
4324 #pragma warning(disable:4099)
4325 #pragma warning(disable:26812)
4326 #pragma warning(disable:4584)
4327 #pragma warning(disable:4250)
4328 #pragma warning(disable:26432)
4329 #pragma warning(disable:26435)
4330 #pragma warning(disable:26481)
4331 #pragma warning(disable:26446)
4332 #pragma warning(disable:26434)
4333 #pragma warning(disable:26429)
4334 #pragma warning(disable:26471)
4335 #pragma warning(disable:26474)
4336 #pragma warning(disable:26473)
4337 #pragma warning(disable:26456)
4338 #pragma warning(disable:26485)
4339 #pragma warning(disable:26490)
4340 #pragma warning(disable:26472)
4341 #pragma warning(disable:26482)
4342 #pragma warning(disable:26493)
4344 #if defined(_MSC_VER)
4345 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
4346 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
4347 #define push_msvc_warning() __pragma(warning(push))
4348 #define pop_msvc_warning() __pragma(warning(pop))
4349 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
4351 #define suppress_msvc_warning(...)
4352 #define disable_msvc_warning(...)
4353 #define push_msvc_warning()
4354 #define pop_msvc_warning()
4355 #define push_and_disable_msvc_warning(...)
4358 #if defined(ELC_VOID_NAME)
4363 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
4364 #define noexcept_as_auto MAGIC
4365 #define constexpr_as(...) MAGIC constexpr
4366 #define constexpr_as_auto MAGIC MAGIC constexpr
4368 #define using_method_from_base_t(name,...) \
4369 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
4370 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
4372 return base_t::name(forward<Args>(rest)...);\
4375 #define using_method_from_value(name,value_name,...) \
4376 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
4377 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
4379 return value_name.name(forward<Args>(rest)...);\
4382 #define floop while(__builtin_is_my_dick_still_there())
4383 #define enable_adl(name) void name()noexcept=delete
4385 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
4386 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
4388 #define declvalue(...) (::std::declval<__VA_ARGS__>())
4391 #define template_error(reason) static_assert(template_error_helper<T>,reason)
4393 #define template_warning(reason) template_warning_helper<T>(reason)
4396 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
4397 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
4399 #define is_common_attribute(name) public attribute<T,name<T>>
4400 #define is_special_attribute(name) public attribute<T,name>
4402 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
4403 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
4406 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
4408 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
4411 #define def_common_attribute_with_nothing(name) \
4412 template<typename T>\
4415 #define def_special_attribute_with_nothing(name) \
4418 #define common_attribute_t template<class>class
4419 #define special_attribute_t class
4429 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
4431 #define enabled_by_default class enable_state=void
4433 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
4435 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
4437 #define enable_flag class enable_state
4439 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
4440 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
4441 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
4442 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
4443 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
4446 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
4448 #define get_recursive_lambda_caller(name) \
4449 lambda_with_catch(&)(auto&&...Args){\
4450 return name(name,Args...);\
4455 #define lambda_with_catch(...) [__VA_ARGS__]
4457 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
4459 #define lambda_RLSRRS _my_jb_super_sb_name_
4467 #define elseif else if
4469 #define _big_than_ >
4471 #define _small_than_ <
4473 #if defined(_MSC_VER)
4480 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
4482 #define BREAK_NAMESPACE }
4485 #define template_name template
4487 #define type_name class
4489 #if defined(DEBUG) || defined(_DEBUG)
4490 #define not_in_debug 0
4492 #define not_in_debug 1
4496 #define ec(ch) U ## ch
4498 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
4499 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
4501 #define ELC_TEST_EVENTNAME(name)
4504 #define override_instance_struct \
4506 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
4507 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
4508 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
4509 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
4510 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
4513 #define distinctive __declspec(dllexport)
4519 #define force_inline __forceinline
4520 #elif defined(__GNUC__)
4521 #define force_inline __attribute__((always_inline)) inline
4523 #define force_inline inline
4527 #define with_no_vtable __declspec(novtable)
4529 #define with_no_vtable
4532 #define in_consteval (::std::is_constant_evaluated())
4534 #define no_vtable_struct struct with_no_vtable
4535 #define no_vtable_class class with_no_vtable
4539 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4541 [[noreturn]]
inline void die()noexcept{
4542 #if defined(_MSC_VER)
4545 #if defined(_WINMAIN_)
4546 ::MessageBoxW(NULL,L
"elc died.",NULL,MB_ICONERROR);
4548 ::std::fputs(
"elc died.\n",stderr);
4549 ::std::fflush(stderr);
4553 [[noreturn]]
inline void die_with(
const char_t*err_msg)
noexcept{
4554 #if defined(_MSC_VER)
4557 push_and_disable_msvc_warning(
4564 ::std::mbstate_t stat{};
4565 if(::std::setlocale(LC_CTYPE,
"en_US.utf8")==
nullptr)
4567 push_and_disable_msvc_warning(26494);
4568 char err_msg_in_char[2048];
4569 char* err_msg_write = err_msg_in_char;
4577 s = ::std::c32rtomb(err_msg_write, c, &stat);
4582 *err_msg_write =
'\0';
4583 #if defined(_WINMAIN_)
4584 wchar_t err_msg_in_wchar[2048];
4585 MultiByteToWideChar(CP_UTF8, 0, err_msg_in_char, -1, err_msg_in_wchar, 2048);
4586 ::MessageBoxW(NULL,err_msg_in_wchar,NULL,MB_ICONERROR);
4588 ::std::fputs(
"elc died because:\n",stderr);
4589 ::std::fputs(err_msg_in_char,stderr);
4590 ::std::fputc(
'\n',stderr);
4591 ::std::fflush(stderr);
4598 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
4609 #if defined(_MSC_VER)
4610 #pragma warning(pop)
4612 #undef suppress_msvc_warning
4613 #undef disable_msvc_warning
4614 #undef push_msvc_warning
4615 #undef pop_msvc_warning
4616 #undef push_and_disable_msvc_warning
4619 #undef BIT_POSSIBILITY
4621 #if defined(ELC_VOID_NAME)
4622 #define void the_void
4627 #undef noexcept_as_auto
4629 #undef constexpr_as_auto
4631 #undef using_method_from_base_t
4632 #undef using_method_from_value
4642 #undef template_error
4643 #undef template_warning
4648 #undef is_common_attribute
4649 #undef is_special_attribute
4651 #undef has_attribute
4652 #undef not_has_attribute
4654 #undef float_size_of
4657 #undef def_common_attribute_with_nothing
4658 #undef def_special_attribute_with_nothing
4660 #undef common_attribute_t
4661 #undef special_attribute_t
4664 #undef enabled_by_default
4665 #undef disabled_by_default
4666 #undef enable_if_not_ill_form
4669 #undef was_an_ill_form
4670 #undef was_an_ill_form_with_parameter
4671 #undef was_not_an_ill_form
4672 #undef was_not_an_ill_form_and_noexcept
4673 #undef was_not_an_ill_form_with_parameter
4675 #undef recursive_lambda
4676 #undef get_recursive_lambda_caller
4678 #undef lambda_with_catch
4679 #undef self_recursion
4680 #undef lambda_RLSRRS
4690 #if defined(_MSC_VER)
4696 #undef INTER_NAMESPACE
4697 #undef BREAK_NAMESPACE
4702 #undef template_name
4710 #undef ELC_TEST_EVENTNAME
4712 #undef override_instance_struct
4718 #undef with_no_vtable
4722 #undef no_vtable_struct
4723 #undef no_vtable_class
4727 #line 78 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/die.hpp"
4729 namespace elc::defs{
4730 using namespace elc::APIs::die;
4736 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
4739 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4752 #if !defined(ELC_LOCALE)
4756 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
4766 typedef char32_t char_t;
4768 typedef int64_t int_t;
4770 typedef uint64_t uint_t;
4772 typedef double float_t;
4774 typedef long double float_size_t;
4779 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4780 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/_char.hpp"
4788 namespace elc::defs::locale{
4789 inline const ::std::locale default_locale{
"en_US.utf8"};
4791 template <
class charT>
bool isspace (charT c){
return isspace (c,default_locale); }
4792 template <
class charT>
bool isprint (charT c){
return isprint (c,default_locale); }
4793 template <
class charT>
bool iscntrl (charT c){
return iscntrl (c,default_locale); }
4794 template <
class charT>
bool isupper (charT c){
return isupper (c,default_locale); }
4795 template <
class charT>
bool islower (charT c){
return islower (c,default_locale); }
4796 template <
class charT>
bool isalpha (charT c){
return isalpha (c,default_locale); }
4797 template <
class charT>
bool isdigit (charT c){
return isdigit (c,default_locale); }
4798 template <
class charT>
bool ispunct (charT c){
return ispunct (c,default_locale); }
4799 template <
class charT>
bool isxdigit(charT c){
return isxdigit(c,default_locale); }
4800 template <
class charT>
bool isalnum (charT c){
return isalnum (c,default_locale); }
4801 template <
class charT>
bool isgraph (charT c){
return isgraph (c,default_locale); }
4802 template <
class charT> charT toupper(charT c){
return toupper (c,default_locale); }
4803 template <
class charT> charT tolower(charT c){
return tolower (c,default_locale); }
4809 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4811 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
4820 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
4824 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
4826 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4838 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4840 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
4851 #define BIT_POSSIBILITY 2
4855 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
4857 #if defined(_MSC_VER)
4858 #pragma warning(push,ELC_WARNING_LEVEL)
4859 #pragma warning(disable:4099)
4860 #pragma warning(disable:26812)
4861 #pragma warning(disable:4584)
4862 #pragma warning(disable:4250)
4863 #pragma warning(disable:26432)
4864 #pragma warning(disable:26435)
4865 #pragma warning(disable:26481)
4866 #pragma warning(disable:26446)
4867 #pragma warning(disable:26434)
4868 #pragma warning(disable:26429)
4869 #pragma warning(disable:26471)
4870 #pragma warning(disable:26474)
4871 #pragma warning(disable:26473)
4872 #pragma warning(disable:26456)
4873 #pragma warning(disable:26485)
4874 #pragma warning(disable:26490)
4875 #pragma warning(disable:26472)
4876 #pragma warning(disable:26482)
4877 #pragma warning(disable:26493)
4879 #if defined(_MSC_VER)
4880 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
4881 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
4882 #define push_msvc_warning() __pragma(warning(push))
4883 #define pop_msvc_warning() __pragma(warning(pop))
4884 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
4886 #define suppress_msvc_warning(...)
4887 #define disable_msvc_warning(...)
4888 #define push_msvc_warning()
4889 #define pop_msvc_warning()
4890 #define push_and_disable_msvc_warning(...)
4893 #if defined(ELC_VOID_NAME)
4898 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
4899 #define noexcept_as_auto MAGIC
4900 #define constexpr_as(...) MAGIC constexpr
4901 #define constexpr_as_auto MAGIC MAGIC constexpr
4903 #define using_method_from_base_t(name,...) \
4904 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
4905 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
4907 return base_t::name(forward<Args>(rest)...);\
4910 #define using_method_from_value(name,value_name,...) \
4911 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
4912 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
4914 return value_name.name(forward<Args>(rest)...);\
4917 #define floop while(__builtin_is_my_dick_still_there())
4918 #define enable_adl(name) void name()noexcept=delete
4920 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
4921 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
4923 #define declvalue(...) (::std::declval<__VA_ARGS__>())
4926 #define template_error(reason) static_assert(template_error_helper<T>,reason)
4928 #define template_warning(reason) template_warning_helper<T>(reason)
4931 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
4932 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
4934 #define is_common_attribute(name) public attribute<T,name<T>>
4935 #define is_special_attribute(name) public attribute<T,name>
4937 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
4938 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
4941 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
4943 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
4946 #define def_common_attribute_with_nothing(name) \
4947 template<typename T>\
4950 #define def_special_attribute_with_nothing(name) \
4953 #define common_attribute_t template<class>class
4954 #define special_attribute_t class
4964 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
4966 #define enabled_by_default class enable_state=void
4968 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
4970 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
4972 #define enable_flag class enable_state
4974 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
4975 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
4976 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
4977 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
4978 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
4981 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
4983 #define get_recursive_lambda_caller(name) \
4984 lambda_with_catch(&)(auto&&...Args){\
4985 return name(name,Args...);\
4990 #define lambda_with_catch(...) [__VA_ARGS__]
4992 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
4994 #define lambda_RLSRRS _my_jb_super_sb_name_
5002 #define elseif else if
5004 #define _big_than_ >
5006 #define _small_than_ <
5008 #if defined(_MSC_VER)
5015 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
5017 #define BREAK_NAMESPACE }
5020 #define template_name template
5022 #define type_name class
5024 #if defined(DEBUG) || defined(_DEBUG)
5025 #define not_in_debug 0
5027 #define not_in_debug 1
5031 #define ec(ch) U ## ch
5033 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
5034 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
5036 #define ELC_TEST_EVENTNAME(name)
5039 #define override_instance_struct \
5041 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
5042 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
5043 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
5044 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
5045 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
5048 #define distinctive __declspec(dllexport)
5054 #define force_inline __forceinline
5055 #elif defined(__GNUC__)
5056 #define force_inline __attribute__((always_inline)) inline
5058 #define force_inline inline
5062 #define with_no_vtable __declspec(novtable)
5064 #define with_no_vtable
5067 #define in_consteval (::std::is_constant_evaluated())
5069 #define no_vtable_struct struct with_no_vtable
5070 #define no_vtable_class class with_no_vtable
5074 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
5075 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/zh_cn.hpp"
5088 namespace elc::defs::locale::func{
5091 namespace elc::defs::locale::str{
5092 inline namespace gc{
5093 inline constexpr auto gc_fail=es
"gc失败"_constexpr_str;
5094 inline constexpr auto empty_gc_method=es
"gc方法为空时gc被调用"_constexpr_str;
5096 inline namespace code_convert{
5097 inline constexpr auto setlocale_error=es
"setlocale出错"_constexpr_str;
5098 inline constexpr auto code_convert_error=es
"编码转换出错"_constexpr_str;
5100 inline namespace lib_load{
5101 inline constexpr auto null_lib=es
"访问null处的lib对象"_constexpr_str;
5103 inline namespace exception{
5104 inline constexpr auto unknow_error=es
"未知错误"_constexpr_str;
5105 inline constexpr auto core_runtime_internal_helper_leak=es
"未知错误"_constexpr_str;
5107 inline namespace base_read{
5108 inline constexpr auto ending_of_expr_beyond_expectations=es
"表达式的结尾超出预期"_constexpr_str;
5109 inline constexpr auto expr_incomplete=es
"表达式未完成"_constexpr_str;
5110 inline constexpr auto symbol_is_undefined=es
"此符号未定义"_constexpr_str;
5111 inline constexpr auto expr_too_outrageous=es
"表达式过于离谱"_constexpr_str;
5113 inline namespace package_symbol_loader{
5114 inline constexpr auto load_failed=es
"无法加载的package_symbol_loader"_constexpr_str;
5115 inline constexpr auto load_interface_failed=es
"package_symbol_loader缺失load_interface"_constexpr_str;
5121 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
5122 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
5133 #if defined(_MSC_VER)
5134 #pragma warning(pop)
5136 #undef suppress_msvc_warning
5137 #undef disable_msvc_warning
5138 #undef push_msvc_warning
5139 #undef pop_msvc_warning
5140 #undef push_and_disable_msvc_warning
5143 #undef BIT_POSSIBILITY
5145 #if defined(ELC_VOID_NAME)
5146 #define void the_void
5151 #undef noexcept_as_auto
5153 #undef constexpr_as_auto
5155 #undef using_method_from_base_t
5156 #undef using_method_from_value
5166 #undef template_error
5167 #undef template_warning
5172 #undef is_common_attribute
5173 #undef is_special_attribute
5175 #undef has_attribute
5176 #undef not_has_attribute
5178 #undef float_size_of
5181 #undef def_common_attribute_with_nothing
5182 #undef def_special_attribute_with_nothing
5184 #undef common_attribute_t
5185 #undef special_attribute_t
5188 #undef enabled_by_default
5189 #undef disabled_by_default
5190 #undef enable_if_not_ill_form
5193 #undef was_an_ill_form
5194 #undef was_an_ill_form_with_parameter
5195 #undef was_not_an_ill_form
5196 #undef was_not_an_ill_form_and_noexcept
5197 #undef was_not_an_ill_form_with_parameter
5199 #undef recursive_lambda
5200 #undef get_recursive_lambda_caller
5202 #undef lambda_with_catch
5203 #undef self_recursion
5204 #undef lambda_RLSRRS
5214 #if defined(_MSC_VER)
5220 #undef INTER_NAMESPACE
5221 #undef BREAK_NAMESPACE
5226 #undef template_name
5234 #undef ELC_TEST_EVENTNAME
5236 #undef override_instance_struct
5242 #undef with_no_vtable
5246 #undef no_vtable_struct
5247 #undef no_vtable_class
5251 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
5257 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
5259 namespace elc::defs{
5260 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
5268 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
5280 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
5282 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
5293 #define BIT_POSSIBILITY 2
5297 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
5299 #if defined(_MSC_VER)
5300 #pragma warning(push,ELC_WARNING_LEVEL)
5301 #pragma warning(disable:4099)
5302 #pragma warning(disable:26812)
5303 #pragma warning(disable:4584)
5304 #pragma warning(disable:4250)
5305 #pragma warning(disable:26432)
5306 #pragma warning(disable:26435)
5307 #pragma warning(disable:26481)
5308 #pragma warning(disable:26446)
5309 #pragma warning(disable:26434)
5310 #pragma warning(disable:26429)
5311 #pragma warning(disable:26471)
5312 #pragma warning(disable:26474)
5313 #pragma warning(disable:26473)
5314 #pragma warning(disable:26456)
5315 #pragma warning(disable:26485)
5316 #pragma warning(disable:26490)
5317 #pragma warning(disable:26472)
5318 #pragma warning(disable:26482)
5319 #pragma warning(disable:26493)
5321 #if defined(_MSC_VER)
5322 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
5323 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
5324 #define push_msvc_warning() __pragma(warning(push))
5325 #define pop_msvc_warning() __pragma(warning(pop))
5326 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
5328 #define suppress_msvc_warning(...)
5329 #define disable_msvc_warning(...)
5330 #define push_msvc_warning()
5331 #define pop_msvc_warning()
5332 #define push_and_disable_msvc_warning(...)
5335 #if defined(ELC_VOID_NAME)
5340 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
5341 #define noexcept_as_auto MAGIC
5342 #define constexpr_as(...) MAGIC constexpr
5343 #define constexpr_as_auto MAGIC MAGIC constexpr
5345 #define using_method_from_base_t(name,...) \
5346 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
5347 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
5349 return base_t::name(forward<Args>(rest)...);\
5352 #define using_method_from_value(name,value_name,...) \
5353 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
5354 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
5356 return value_name.name(forward<Args>(rest)...);\
5359 #define floop while(__builtin_is_my_dick_still_there())
5360 #define enable_adl(name) void name()noexcept=delete
5362 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
5363 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
5365 #define declvalue(...) (::std::declval<__VA_ARGS__>())
5368 #define template_error(reason) static_assert(template_error_helper<T>,reason)
5370 #define template_warning(reason) template_warning_helper<T>(reason)
5373 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
5374 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
5376 #define is_common_attribute(name) public attribute<T,name<T>>
5377 #define is_special_attribute(name) public attribute<T,name>
5379 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
5380 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
5383 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
5385 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
5388 #define def_common_attribute_with_nothing(name) \
5389 template<typename T>\
5392 #define def_special_attribute_with_nothing(name) \
5395 #define common_attribute_t template<class>class
5396 #define special_attribute_t class
5406 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
5408 #define enabled_by_default class enable_state=void
5410 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
5412 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
5414 #define enable_flag class enable_state
5416 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
5417 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
5418 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
5419 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
5420 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
5423 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
5425 #define get_recursive_lambda_caller(name) \
5426 lambda_with_catch(&)(auto&&...Args){\
5427 return name(name,Args...);\
5432 #define lambda_with_catch(...) [__VA_ARGS__]
5434 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
5436 #define lambda_RLSRRS _my_jb_super_sb_name_
5444 #define elseif else if
5446 #define _big_than_ >
5448 #define _small_than_ <
5450 #if defined(_MSC_VER)
5457 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
5459 #define BREAK_NAMESPACE }
5462 #define template_name template
5464 #define type_name class
5466 #if defined(DEBUG) || defined(_DEBUG)
5467 #define not_in_debug 0
5469 #define not_in_debug 1
5473 #define ec(ch) U ## ch
5475 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
5476 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
5478 #define ELC_TEST_EVENTNAME(name)
5481 #define override_instance_struct \
5483 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
5484 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
5485 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
5486 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
5487 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
5490 #define distinctive __declspec(dllexport)
5496 #define force_inline __forceinline
5497 #elif defined(__GNUC__)
5498 #define force_inline __attribute__((always_inline)) inline
5500 #define force_inline inline
5504 #define with_no_vtable __declspec(novtable)
5506 #define with_no_vtable
5509 #define in_consteval (::std::is_constant_evaluated())
5511 #define no_vtable_struct struct with_no_vtable
5512 #define no_vtable_class class with_no_vtable
5516 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
5520 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
5523 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
5532 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/defs.hpp"
5541 namespace lifetime_n{
5549 template<
class T,
class...Args>
5550 constexpr bool construct_able=::std::is_constructible_v<T,Args...>;
5551 template<
class T,
class...Args>
5552 constexpr bool construct_nothrow=::std::is_nothrow_constructible_v<T,Args...>;
5553 template<
class T,
class...Args>
5554 constexpr bool construct_trivial=::std::is_trivially_constructible_v<T,Args...>;
5558 constexpr bool destruct_able=::std::is_destructible_v<T>;
5560 constexpr bool destruct_nothrow=::std::is_nothrow_destructible_v<T>;
5562 constexpr bool destruct_trivial=::std::is_trivially_destructible_v<T>;
5565 class copy_construct_t;
5567 constexpr bool copy_construct_able=::std::is_copy_constructible_v<T>;
5569 constexpr bool copy_construct_nothrow=::std::is_nothrow_copy_constructible_v<T>;
5571 constexpr bool copy_construct_trivial=::std::is_trivially_copy_constructible_v<T>;
5573 class move_construct_t;
5575 constexpr bool move_construct_able=::std::is_move_constructible_v<T>;
5577 constexpr bool move_construct_nothrow=::std::is_nothrow_move_constructible_v<T>;
5579 constexpr bool move_construct_trivial=::std::is_trivially_move_constructible_v<T>;
5582 class copy_assign_t;
5584 constexpr bool copy_assign_able=::std::is_copy_assignable_v<T>;
5586 constexpr bool copy_assign_nothrow=::std::is_nothrow_copy_assignable_v<T>;
5588 constexpr bool copy_assign_trivial=::std::is_trivially_copy_assignable_v<T>;
5590 class move_assign_t;
5592 constexpr bool move_assign_able=::std::is_move_assignable_v<T>;
5594 constexpr bool move_assign_nothrow=::std::is_nothrow_move_assignable_v<T>;
5596 constexpr bool move_assign_trivial=::std::is_trivially_move_assignable_v<T>;
5599 template<
class T>
requires(::std::is_trivially_copyable_v<T>)
5600 force_inline T* super_speed_trivial_copy_from_one(T*to,
const T&value,
size_t size)
noexcept{
5601 if constexpr(
sizeof(T)==
sizeof(
unsigned char))
5602 ::std::memset((
unsigned char*)to,(
unsigned char)value,size);
5603 elseif
constexpr(
sizeof(T)==
sizeof(
wchar_t))
5604 ::std::wmemset((
wchar_t*)to,(wchar_t)value,size);
5606 if(is_all_byte_zero(value))
5607 ::std::memset(to,zero,size*
sizeof(T));
5609 ::std::fill_n(to,size,value);
5612 template<
class T>
requires(::std::is_trivially_copyable_v<T>)
5613 force_inline T* super_speed_trivial_copy_from_one(T*to,
const T&value)
noexcept{
5614 if constexpr(
sizeof(T)>=
sizeof(::std::max_align_t))
5615 if(is_all_byte_zero(value))
5616 ::std::memset(to,zero,
sizeof(T));
5634 template<
typename T>
5637 template<
class...Args>
5638 static constexpr bool able=construct_able<T,Args...>;
5639 template<
class...Args>
5640 static constexpr bool nothrow=construct_nothrow<T,Args...>;
5641 template<
class...Args>
5642 static constexpr bool trivial=construct_trivial<T,Args...>;
5644 template<
class...Args>
requires able<Args...>
5645 [[nodiscard]]force_inline T operator()(Args&&...rest)
const noexcept(nothrow<Args...>){
5646 return T(forward<Args>(rest)...);
5651 constexpr void never_in_array_check()
const noexcept{
5653 template_error(
"You can\'t construct an array for never_in_array type.");
5655 template<
class...Args>
requires able<Args...>
5656 force_inline
void base_call(Args&&...rest)
const noexcept(nothrow<Args...>){
5658 while(tmp--)
new(_to+tmp)T(forward<Args>(rest)...);
5660 template<
class...Args>
requires able<Args...>
5661 force_inline T* operator()(Args&&...rest)
const noexcept(nothrow<Args...>){
5662 never_in_array_check();
5663 base_call(forward<Args>(rest)...);
5667 force_inline T* operator()(
const T&v)
const noexcept(nothrow<const T&>)
requires able<const T&>{
5668 never_in_array_check();
5669 if constexpr(trivial<const T&> && ::std::is_trivially_copyable_v<T>)
5670 super_speed_trivial_copy_from_one(_to,v,_size);
5672 base_call(forward<const T&>(v));
5676 force_inline T* operator()()
const noexcept(nothrow<>)
requires able<>{
5677 never_in_array_check();
5678 if constexpr(!trivial<>)
5685 template<
class...Args>
requires able<Args...>
5686 force_inline
void base_call(Args&&...rest)
const noexcept(nothrow<Args...>){
5687 new(_to)T(forward<Args>(rest)...);
5689 template<
class...Args>
requires able<Args...>
5690 force_inline T* operator()(Args&&...rest)
const noexcept(nothrow<Args...>){
5691 base_call(forward<Args>(rest)...);
5695 force_inline T* operator()(
const T&v)
const noexcept(nothrow<const T&>)
requires able<const T&>{
5696 if constexpr(trivial<const T&> && ::std::is_trivially_copyable_v<T>)
5697 super_speed_trivial_copy_from_one(_to,v);
5699 base_call(forward<const T&>(v));
5703 force_inline T* operator()()
const noexcept(nothrow<>)
requires able<>{
5704 if constexpr(!trivial<>)
5708 [[nodiscard]]force_inline
constexpr array_construct_t operator[](
size_t size)
const noexcept{
return{_to,size};}
5723 template<
typename T>
5724 constexpr construct_t<T>construct{};
5738 static constexpr bool able=destruct_able<T>||(::std::is_array_v<T>&&able<::std::remove_extent_t<T>>);
5740 static constexpr bool nothrow=destruct_nothrow<T>||(::std::is_array_v<T>&¬hrow<::std::remove_extent_t<T>>);
5742 static constexpr bool trivial=destruct_trivial<T>||(::std::is_array_v<T>&&trivial<::std::remove_extent_t<T>>);
5744 template<
class T>
requires able<T>
5745 static force_inline
void base_call(T*to)
noexcept(nothrow<T>){
5746 if constexpr(!trivial<T>)
5747 if constexpr(::std::is_array_v<T>)
5749 base_call(addressof(i));
5751 suppress_msvc_warning(26457)
5755 template<
class T>
requires able<T>
5756 static void base_call([[maybe_unused]]T*begin,[[maybe_unused]]
size_t size)
noexcept(nothrow<T>){
5758 template_error(
"You cannot perform array operations on never_in_array type.");
5759 if constexpr(!trivial<T>)
5760 while(size--)base_call(begin+size);
5763 template<
class T>
requires able<T>
5764 force_inline
void operator()(T*begin)
const noexcept(nothrow<T>){
5770 template<
class T>
requires able<T>
5771 force_inline
void operator()(T*begin)
const noexcept(nothrow<T>){
5772 base_call(begin,_size);
5776 [[nodiscard]]force_inline
constexpr array_destruct_t operator[](
size_t size)
const noexcept{
return{size};}
5780 force_inline
constexpr not_t operator!()const noexcept{
return not_t{};}
5797 template<
class T,
class...Args>
5798 static constexpr bool able=destruct.able<T>&&construct<T>.able<Args...>;
5799 template<
class T,
class...Args>
5800 static constexpr bool nothrow=destruct.nothrow<T>&&construct<T>.nothrow<Args...>;
5801 template<
class T,
class...Args>
5802 static constexpr bool trivial=destruct.trivial<T>&&construct<T>.trivial<Args...>;
5804 template<
class T>
requires able<T>
5805 force_inline T* operator()(T*to)
const noexcept(nothrow<T>){
5814 template<
class...Args>
requires able<T,Args...>
5815 T* operator()(Args&&...rest)
const noexcept(nothrow<T,Args...>){
5817 template_error(
"You cannot perform array operations on never_in_array type.");
5818 destruct[_size](_to);
5819 construct<T>[_to][_size](forward<Args>(rest)...);
5826 template<
class...Args>
requires able<T,Args...>
5827 T* operator()(Args&&...rest)
const noexcept(nothrow<T,Args...>){
5829 construct<T>[_to](forward<Args>(rest)...);
5832 [[nodiscard]]force_inline
constexpr array_re_construct_t<T> operator[](
size_t size)
const noexcept{
return{_to,size};}
5840 static constexpr bool r_able=copy_construct_able<T>?
5841 copy_construct_trivial<T>||!(construct<T>.trivial<>&©_assign_trivial<T>)
5844 static constexpr bool able=r_able<T>?
true:(construct<T>.able<>&©_assign_able<T>);
5846 static constexpr bool nothrow=r_able<T>?copy_construct_nothrow<T>:
5847 (construct<T>.nothrow<>&©_assign_nothrow<T>);
5849 static constexpr bool trivial=r_able<T>?copy_construct_trivial<T>:
5850 (construct<T>.trivial<>&©_assign_trivial<T>);
5852 template<
class T>
requires able<T>
5853 static T*base_call(T*to,
const T*from)
noexcept(nothrow<T>){
5854 if constexpr(trivial<T>)
5855 return reinterpret_cast<T*
>(::std::memcpy(to,add_const(from),
sizeof(T)));
5857 if constexpr(r_able<T>)
5867 template<
class T>
requires able<T>
5868 static T*base_call(T*to,
const T*from,
size_t size)
noexcept(nothrow<T>){
5869 if constexpr(trivial<T>)
5870 return reinterpret_cast<T*
>(::std::memcpy(to,add_const(from),
sizeof(T)*size));
5873 base_call(to+size,from+size);
5878 template<
class T>
requires able<T>
5879 force_inline T*operator()(T*to,
const T*from)
const noexcept(nothrow<T>)
5880 {
return base_call(to,from);}
5882 template<
class T>
requires able<T>
5884 {
return base_call(to(),from());}
5886 template<
class T>
requires able<T>
5888 {
return base_call(to(),from());}
5891 template<
class T>
requires able<T>
5892 force_inline T*operator()(T*to,
const T*from,
size_t size)
const noexcept(nothrow<T>)
5893 {
return base_call(to,from,size);}
5895 template<
class T>
requires able<T>
5897 {
return base_call(to(),from(),size);}
5899 template<
class T>
requires able<T>
5901 {
return base_call(to(),from(),size);}
5903 template<
class T>
requires able<T>
5904 static T*base_call(T*to,
const T&from)
noexcept(nothrow<T>){
5905 if constexpr(r_able<T>)
5906 construct<T>[to](from);
5914 template<
class T>
requires able<T>
5915 static T*base_call(T*to,
const T&from,
size_t size)
noexcept(nothrow<T>){
5917 template_error(
"You cannot perform array operations on never_in_array type.");
5918 if constexpr(::std::is_trivially_copyable_v<T>)
5919 super_speed_trivial_copy_from_one(to,from,size);
5922 base_call(to+size,from);
5926 template<
class T>
requires able<T>
5927 force_inline T*operator()(T*to,
const T&from)
const noexcept(nothrow<T>)
5928 {
return base_call(to,from);}
5932 template<
class T>
requires able<T>
5933 force_inline T*operator()(T*to,
const T*from)
const noexcept(nothrow<T>){
5934 return base_call(to,from,_size);
5936 template<
class T>
requires able<T>
5937 force_inline T*operator()(T*to,
const T&from)
const noexcept(nothrow<T>){
5938 return base_call(to,from,_size);
5940 template<
class T>
requires able<T>
5942 return operator()(to(),from());
5944 template<
class T>
requires able<T>
5946 return operator()(to(),from());
5949 [[nodiscard]]force_inline
constexpr array_copy_construct_t operator[](
size_t a)
const noexcept{
return{a};}
5954 static constexpr bool r_able=move_construct_able<T>?
5955 move_construct_trivial<T>||!copy_construct.trivial<T>
5958 static constexpr bool able=r_able<T>?
true:copy_construct.able<T>;
5960 static constexpr bool nothrow=r_able<T>?move_construct_nothrow<T>:
5961 copy_construct.nothrow<T>;
5963 static constexpr bool trivial=r_able<T>?move_construct_trivial<T>:
5964 copy_construct.trivial<T>;
5966 template<
class T>
requires able<T>
5967 static T*base_call(T*to,T*from)
noexcept(nothrow<T>){
5968 if constexpr(trivial<T>)
5969 return reinterpret_cast<T*
>(::std::memcpy(to,add_const(from),
sizeof(T)));
5971 if constexpr(r_able<T>){
5972 construct<T>[to](::std::move(*from));
5975 return copy_construct(to,from);
5978 template<
class T>
requires able<T>
5979 static T*base_call(T*to,T*from,
size_t size)
noexcept(nothrow<T>){
5981 template_error(
"You cannot perform array operations on never_in_array type.");
5982 if constexpr(trivial<T>)
5983 return reinterpret_cast<T*
>(::std::memcpy(to,add_const(from),
sizeof(T)*size));
5985 if constexpr(r_able<T>){
5987 construct<T>[to+size](::std::move(from[size]));
5990 return copy_construct[size](to,from);
5994 template<
class T>
requires able<T>
5995 force_inline T*operator()(T*to,T*from)
const noexcept(nothrow<T>)
5996 {
return base_call(to,from);}
5998 template<
class T>
requires able<T>
6000 {
return base_call(to(),from());}
6002 template<
class T>
requires able<T>
6004 {
return base_call(to(),from());}
6008 template<
class T>
requires able<T>
6009 force_inline T*operator()(T*to,T*from)
const noexcept(nothrow<T>){
6010 return base_call(to,from,_size);
6012 template<
class T>
requires able<T>
6014 return operator()(to(),from());
6016 template<
class T>
requires able<T>
6018 return operator()(to(),from());
6021 [[nodiscard]]force_inline
constexpr array_move_construct_t operator[](
size_t a)
const noexcept{
return{a};}
6026 static constexpr bool able=move_construct.able<T>&&destruct.able<T>;
6028 static constexpr bool nothrow=move_construct.nothrow<T>&&destruct.nothrow<T>;
6030 static constexpr bool trivial=move_construct.trivial<T>&&destruct.trivial<T>;
6032 template<
class T>
requires able<T>
6033 static T*base_call(T*to,T*from)
noexcept(nothrow<T>){
6034 move_construct(to,from);
6038 template<
class T>
requires able<T>
6039 static T*base_call(T*to,T*from,
size_t size)
noexcept(nothrow<T>){
6041 template_error(
"You cannot perform array operations on never_in_array type.");
6042 move_construct[size](to,from);
6043 destruct[size](from);
6047 template<
class T>
requires able<T>
6048 force_inline T*operator()(T*to,T*from)
const noexcept(nothrow<T>)
6049 {
return base_call(to,from);}
6051 template<
class T>
requires able<T>
6053 {
return base_call(to(),from());}
6055 template<
class T>
requires able<T>
6057 {
return base_call(to(),from());}
6061 template<
class T>
requires able<T>
6062 force_inline T*operator()(T*to,T*from)
const noexcept(nothrow<T>){
6063 return base_call(to,from,_size);
6065 template<
class T>
requires able<T>
6067 return operator()(to(),from());
6069 template<
class T>
requires able<T>
6071 return operator()(to(),from());
6074 [[nodiscard]]force_inline
constexpr array_move_t operator[](
size_t a)
const noexcept{
return{a};}
6078 [[nodiscard]]
constexpr remove_ref<T>&& operator()(T&&a)
const noexcept{
6079 return static_cast<remove_ref<T>&&
>(a);
6086 template<
class T>
requires(copy_construct.able<T>)
6087 [[nodiscard]]
constexpr T
operator()(
const T&a)
const noexcept{
6088 return copy_construct<T>(a);
6094 static constexpr bool r_able=copy_assign_able<T>?
6095 copy_assign_trivial<T>||!(copy_construct_trivial<T>&&destruct.trivial<T>)
6098 static constexpr bool able=r_able<T>?
true:(copy_construct_able<T>&&destruct.able<T>);
6100 static constexpr bool nothrow=r_able<T>?copy_assign_nothrow<T>:
6101 (copy_construct_nothrow<T>&&destruct.nothrow<T>);
6103 static constexpr bool trivial=r_able<T>?copy_assign_trivial<T>:
6104 (copy_construct_trivial<T>&&destruct.trivial<T>);
6106 template<
class T>
requires able<T>
6107 static T& base_call(T&a,
const T&b)
noexcept(nothrow<T>){
6108 if constexpr(r_able<T>)
6112 construct<T>[&a](b);
6116 template<
class T>
requires able<T>
6117 static T* base_call(T*to,
const T*from,
size_t size)
noexcept(nothrow<T>){
6118 if constexpr(trivial<T>)
6119 ::std::memcpy(to,add_const(from),size*
sizeof(T));
6122 base_call(to[size],from[size]);
6126 template<
class T>
requires able<T>
6127 static T* base_call(T* to,
const T& from,
size_t size)
noexcept(nothrow<T>){
6128 if constexpr(trivial<T>)
6129 super_speed_trivial_copy_from_one(to,from,size);
6132 base_call(to[size],from);
6136 template<
class T>
requires able<T>
6137 force_inline T& operator()(T&a,
const T&b)
const noexcept(nothrow<T>){
6138 return base_call(a,b);
6143 template<
class T>
requires able<T>
6144 force_inline T*operator()(T*to,
const T*from)
const noexcept(nothrow<T>){
6145 return base_call(to,from,_size);
6147 template<
class T>
requires able<T>
6149 return operator()(to(),from());
6151 template<
class T>
requires able<T>
6153 return operator()(to(),from());
6155 template<
class T>
requires able<T>
6156 force_inline T*operator()(
const T&from,
note::to_t<T*>to)
const noexcept(nothrow<T>){
6157 return base_call(to(),from,_size);
6159 template<
class T>
requires able<T>
6160 force_inline T*operator()(
note::to_t<T*>to,
const T&from)
const noexcept(nothrow<T>){
6161 return base_call(to(),from,_size);
6164 [[nodiscard]]force_inline
constexpr array_copy_assign_t operator[](
size_t a)
const noexcept{
return{a};}
6169 static constexpr bool r_able=move_assign_able<T>;
6171 static constexpr bool able=r_able<T>?
true:copy_assign.able<T>;
6173 static constexpr bool nothrow=r_able<T>?move_assign_nothrow<T>:copy_assign.nothrow<T>;
6175 static constexpr bool trivial=r_able<T>?move_assign_trivial<T>:copy_assign.trivial<T>;
6177 template<
class T>
requires able<T>
6178 static T& base_call(T&a,T&&b)
noexcept(nothrow<T>){
6179 if constexpr(r_able<T>)
6186 template<
class T>
requires able<T>
6187 static T* base_call(T*to,T*from,
size_t size)
noexcept(nothrow<T>){
6188 if constexpr(trivial<T>)
6189 ::std::memcpy(to,add_const(from),size*
sizeof(T));
6192 base_call(to[size],from[size]);
6197 template<
class T>
requires able<T>
6198 force_inline T& operator()(T&a,T&b)
const noexcept(nothrow<T>){
6199 return base_call(a,move(b));
6204 template<
class T>
requires able<T>
6205 force_inline T*operator()(T*to,T*from)
const noexcept(nothrow<T>){
6206 return base_call(to,from,_size);
6208 template<
class T>
requires able<T>
6210 return operator()(to(),from());
6212 template<
class T>
requires able<T>
6214 return operator()(to(),from());
6217 [[nodiscard]]force_inline
constexpr array_move_assign_t operator[](
size_t a)
const noexcept{
return{a};}
6223 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
6224 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_export.hpp"
6233 #define export using lifetime_n::
6236 export re_construct;
6241 export copy_construct;
6242 export move_construct;
6247 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
6248 #if defined(ELC_TEST_ON)
6249 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_test.hpp"
6258 namespace lifetime_n{
6261 ELC_TEST_EVENTNAME(
"lifetime部分测试");
6263 inline void test_log_out(){
6265 inline void test_end(){
6272 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/lifetime/_body.hpp"
6277 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
6281 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6291 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/flag.hpp"
6303 enum flag_set_type:
bool{seted=
true,not_set=
false};
6310 constexpr explicit flag(flag_set_type a=not_set)
noexcept:_m(
bool(a)){}
6311 [[nodiscard]]
explicit operator bool()
const noexcept{
return _m;}
6313 flag(
flag&&a)
noexcept:_m((
bool)a){}
6314 inline void operator=(
flag&)&
noexcept=
delete;
6315 inline void operator=(
flag&&)&
noexcept=
delete;
6316 inline void set()
noexcept{_m=
true;}
6317 inline void unset()
noexcept{_m=
false;}
6322 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6323 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/mark_type.hpp"
6335 enum mark_type:
bool{marked=
true,not_mark=
false};
6339 template<
typename T>
6343 constexpr explicit mark_able(mark_type a=not_mark)
noexcept:_m(a==not_mark?not_set:seted){};
6344 inline void mark()
const noexcept{_m.set();}
6345 inline void unmark()
const noexcept{_m.unset();}
6346 [[nodiscard]]
bool was_marked()
const noexcept{
return(
bool)_m;}
6351 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6353 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/iterator.hpp"
6362 namespace iterator_n{
6363 using namespace memory;
6364 template<
typename base_t_w>
6367 typedef remove_cv<base_t_w> base_t_rw;
6369 template<
typename build_base_t_T>
requires(construct<base_t_rw>.able<build_base_t_T>)
6370 constexpr reverse_base_t(build_base_t_T&& a)
noexcept(construct<base_t_rw>.nothrow<build_base_t_T>):_m(a){}
6371 [[nodiscard]]
auto get_before()noexcept_as(declvalue(base_t_w).get_next()){
return ((base_t_w&)_m).get_next(); }
6372 [[nodiscard]]
auto get_next()noexcept_as(declvalue(base_t_w).get_before()){
return ((base_t_w&)_m).get_before(); }
6373 [[nodiscard]]
auto get_handle()noexcept_as(declvalue(base_t_w).get_handle()){
return ((base_t_w&)_m).get_handle(); }
6375 template<
typename base_t>
requires(compare.able<base_t>)
6377 return compare((
const base_t&)b._m,(
const base_t&)a._m);
6379 template<
typename base_t,
typename T>
requires(compare.able<T,base_t> && type_info<remove_cvref<T>> != type_info<reverse_base_t<base_t>::base_t_rw>)
6380 [[nodiscard]]
auto operator<=>(
const reverse_base_t<base_t>& a,T&& b)
noexcept(compare.nothrow<T,base_t>){
6381 return compare(b,(
const base_t&)a._m);
6383 template<
typename base_t,
typename T>
requires(compare.able<base_t,T> && type_info<remove_cvref<T>> != type_info<reverse_base_t<base_t>::base_t_rw>)
6384 [[nodiscard]]
auto operator<=>(T&& a,
const reverse_base_t<base_t>& b)
noexcept(compare.nothrow<base_t,T>){
6385 return compare((
const base_t&)b._m,a);
6387 template<
typename base_t,
typename T>
requires(equal.able<T,base_t>)
6388 [[nodiscard]]
auto operator==(
const reverse_base_t<base_t>& a,T&& b)
noexcept(equal.nothrow<T,base_t>){
6389 return equal(b,(
const base_t&)a._m);
6391 template<
typename base_t,
typename T>
requires(equal.able<base_t,T>)
6392 [[nodiscard]]
auto operator==(T&& a,
const reverse_base_t<base_t>& b)
noexcept(equal.nothrow<base_t,T>){
6393 return equal((
const base_t&)b._m,a);
6396 template<
typename value_t,
typename base_t_w>
6398 template<
typename,
typename>
6402 typedef remove_cv<base_t_w> base_t_rw;
6404 mutable base_t_rw _m;
6406 [[nodiscard]]
static constexpr bool is_handle_getter_noexcept()
noexcept{
6407 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6409 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_handle()))
6410 return noexcept(declvalue(base_t_w)->get_handle());
6411 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_handle()))
6412 return noexcept(declvalue(base_t_w).get_handle());
6414 [[nodiscard]]
inline value_t*handle_getter()
const noexcept(is_handle_getter_noexcept()){
6415 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6416 return ((base_t_w)_m);
6417 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_handle()))
6418 return ((base_t_w)_m)->get_handle();
6419 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_handle()))
6420 return ((base_t_w)_m).get_handle();
6423 [[nodiscard]]
static constexpr bool is_value_getter_noexcept()
noexcept{
6424 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6426 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_value()))
6427 return noexcept(declvalue(base_t_w)->get_value());
6428 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_value()))
6429 return noexcept(declvalue(base_t_w).get_value());
6432 [[nodiscard]]
static constexpr auto value_type_getter(){
6433 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6434 return type_info<
decltype(*((base_t_w)_m))>;
6435 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_value()))
6436 return type_info<
decltype(((base_t_w)_m)->get_value())>;
6437 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_value()))
6438 return type_info<
decltype(((base_t_w)_m).get_value())>;
6440 return type_info<
decltype(*declvalue(value_t*))>;
6442 typedef decltype(value_type_getter())::template_name type value_type;
6444 [[nodiscard]]
inline value_type value_getter()
const noexcept(is_handle_getter_noexcept()){
6445 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6446 return *((base_t_w)_m);
6447 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_value()))
6448 return ((base_t_w)_m)->get_value();
6449 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_value()))
6450 return ((base_t_w)_m).get_value();
6452 return *handle_getter();
6455 [[nodiscard]]
static constexpr bool is_next_getter_noexcept()
noexcept{
6456 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6458 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_next()))
6459 return noexcept(declvalue(base_t_w)->get_next());
6460 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_next()))
6461 return noexcept(declvalue(base_t_w).get_next());
6463 [[nodiscard]]
inline base_t_w next_getter()
const noexcept(is_next_getter_noexcept()){
6464 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6465 return ((base_t_w)_m)+1;
6466 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_next()))
6467 return ((base_t_w)_m)->get_next();
6468 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_next()))
6469 return ((base_t_w)_m).get_next();
6472 [[nodiscard]]
static constexpr bool is_before_getter_noexcept()
noexcept{
6473 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6475 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_before()))
6476 return noexcept(declvalue(base_t_w)->get_before());
6477 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_before()))
6478 return noexcept(declvalue(base_t_w).get_before());
6480 [[nodiscard]]
inline base_t_w before_getter()
const noexcept(is_before_getter_noexcept()){
6481 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6482 return ((base_t_w)_m)-1;
6483 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w)->get_before()))
6484 return ((base_t_w)_m)->get_before();
6485 elseif
constexpr(was_not_an_ill_form(declvalue(base_t_w).get_before()))
6486 return ((base_t_w)_m).get_before();
6489 constexpr void swap_with(
this_t&a)noexcept_as(swap(declvalue(base_t_rw&),declvalue(base_t_rw&))){swap(_m,a._m);}
6492 template<
typename build_base_t_T>
requires(construct<base_t_rw>.able<build_base_t_T>)
6493 constexpr same_base_t(build_base_t_T&&a)
noexcept(construct<base_t_rw>.nothrow<build_base_t_T>):_m(a){}
6494 constexpr same_base_t(
const this_t&a)
noexcept(construct<base_t_rw>.nothrow<
const base_t_rw>):_m(a._m){}
6496 template<
typename other_T,
typename other_base_t>
requires(construct<base_t_rw>.able<other_base_t>)
6498 ~same_base_t()
noexcept(destruct.nothrow<base_t_rw>)=
default;
6499 [[nodiscard]]
constexpr bool operator==(
const this_t& a)
const noexcept_as(declvalue(base_t_rw) == declvalue(base_t_rw)){
return _m == a._m; }
6500 [[nodiscard]]
constexpr value_t* operator->()
noexcept(is_handle_getter_noexcept()){
return handle_getter(); }
6501 [[nodiscard]]
constexpr value_type operator*()noexcept_as(is_value_getter_noexcept()){
return value_getter(); }
6502 [[nodiscard]]
constexpr operator value_t*()noexcept_as(declvalue(
this_t).operator->()){
return operator->(); }
6503 [[nodiscard]]
constexpr bool operator==(value_t* a)
const noexcept(is_handle_getter_noexcept()&&
noexcept(pointer_equal(declvalue(value_t*),declvalue(value_t*)))){
return pointer_equal(handle_getter(),a); }
6504 template<
typename other_value_t,
typename other_base_t_w>
requires(equal.able<base_t_rw,other_base_t_w>)
6506 return equal(_m,a._m);
6508 template<
typename other_value_t,
typename other_base_t_w>
6510 if constexpr(compare.able<base_t_rw,other_base_t_w>)
6511 return compare(_m,a._m);
6514 template<
typename value_t,
typename base_t_w>
6518 template<
typename value_t,
typename base_t_w>
6523 using base_t::is_before_getter_noexcept;
6524 using base_t::is_next_getter_noexcept;
6525 using base_t::before_getter;
6526 using base_t::next_getter;
6527 typedef remove_cv<base_t_w> base_t_rw;
6529 using base_t::base_t;
6530 constexpr this_t&operator=(
const base_t_rw&a)&
noexcept(copy_assign.nothrow<base_t_rw>){copy_assign(base_t::_m,a);
return*
this;}
6531 constexpr this_t&operator=(base_t_rw&&a)&
noexcept(move_assign.nothrow<base_t_rw>){move_assign(base_t::_m,a);
return*
this;}
6532 constexpr this_t&operator++()&
noexcept(is_next_getter_noexcept()){
return*
this=next_getter();}
6533 constexpr this_t&operator--()&
noexcept(is_before_getter_noexcept()){
return*
this=before_getter();}
6534 constexpr this_t operator++(
int)&noexcept_as(
this_t(++declvalue(
this_t&))){
auto a=*
this;operator++();
return a;}
6535 constexpr this_t operator--(
int)&noexcept_as(
this_t(--declvalue(
this_t&))){
auto a=*
this;operator--();
return a;}
6537 if constexpr(type_info<::std::remove_pointer_t<base_t_w>> == type_info<value_t>)
6538 return base_t::_m+num;
6550 constexpr this_t operator-(ptrdiff_t num)
const noexcept_as(declvalue(
this_t&)+0){
return *
this+(-num); }
6552 template<
typename value_t,
typename base_t_w>
6554 template<
typename value_t,
typename base_t_w>
6557 template<
typename value_t,
typename base_t_w=value_t*>
6559 template<
typename value_t,
typename base_t_w=const value_t*>
6561 template<
typename value_t,
typename base_t_w=value_t*>
6563 template<
typename value_t,
typename base_t_w=const value_t*>
6574 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6575 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/list.hpp"
6585 template<
typename T>
6590 template<
typename T>
6595 friend iterator_t<T,this_t*>::base_t;
6601 [[nodiscard]]
this_t*get_before()
noexcept{
return _before;}
6602 [[nodiscard]]
this_t*get_next()
noexcept{
return _next;}
6606 constexpr void set_before(
this_t*a){
6610 constexpr void set_next(
this_t*a){
6614 constexpr void insert_to_before(
this_t*a){
6615 set_before(a->_before);
6618 constexpr void bind_with(
this_t*a)
noexcept{
6622 constexpr void remove_from_list()
noexcept{
6623 _before->set_next(_next);
6625 [[nodiscard]]
constexpr T*get_handle(){
6626 return attribute_t::get_handle();
6629 constexpr cons_t()=
default;
6643 template<
typename T>
6647 typedef iterator_t<T,cons*>iterator;
6651 constexpr list_t()
noexcept{_begin.bind_with(&_end);}
6652 inline constexpr void add(
cons*a)
noexcept{
6653 a->insert_to_before(&_end);
6655 [[nodiscard]]
constexpr iterator begin()
noexcept{
return _begin.get_next();}
6656 [[nodiscard]]
constexpr iterator end()
noexcept{
return&_end;}
6657 [[nodiscard]]
constexpr iterator head()
noexcept{
return&_begin;}
6658 [[nodiscard]]
constexpr bool empty()
const noexcept{
return _begin.get_next()==&_end;}
6663 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6665 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/function_base.hpp"
6674 namespace function_base_n{
6675 #if !defined(_MSC_VER)
6679 template<
typename Ret_t,
typename T,
typename...Args_t,
bool nothrow>
6681 {
using type=Ret_t(Args_t...)
noexcept(nothrow);};
6683 template<
typename Ret_t,
typename T,
typename...Args_t,
bool nothrow>
6685 {
using type=Ret_t(Args_t...)
noexcept(nothrow);};
6687 template<
typename Ret_t,
typename T,
typename...Args_t,
bool nothrow>
6689 {
using type=Ret_t(Args_t...)
noexcept(nothrow);};
6691 template<
typename Ret_t,
typename T,
typename...Args_t,
bool nothrow>
6693 {
using type=Ret_t(Args_t...)
noexcept(nothrow);};
6695 template<
typename T>
6696 [[nodiscard]]
constexpr auto function_type_getter_conditional_helper(){
6697 if constexpr(::std::is_function_v<T>)
6698 return type_info<T>;
6699 elseif
constexpr(is_pointer<T> && ::std::is_function_v<::std::remove_pointer_t<T>>)
6700 return function_type_getter_conditional_helper<::std::remove_pointer_t<T>>();
6704 template<
typename T>
6706 typedef decltype(function_type_getter_conditional_helper<T>())::template_name type type;
6713 template<
typename T>
6714 using get_function_type=function_type_getter<T>::type;
6720 template<
class T,
class Func_t=get_function_type<T>>
6722 template<
class T,
bool nothrow,
class Ret_t,
class...Args_t>
6724 static_assert(!::std::is_function_v<T>);
6730 Ret_t operator()(Args_t...args)
noexcept(nothrow || invoke<T>.nothrow<Args_t...>){
6732 if constexpr(!invoke<T>.able<Args_t...>)
6733 template_error(
"this T can\'t becall as args.");
6734 if constexpr(was_an_ill_form(
static_cast<Ret_t
>(declvalue(T)(declvalue(Args_t)...))))
6735 template_error(
"the return type of T was wrong.");
6737 if constexpr(type_info<Ret_t> != type_info<void>)
6738 return _value(forward<Args_t>(args)...);
6740 _value(forward<Args_t>(args)...);
6742 Ret_t operator()(Args_t...args)
const noexcept(nothrow || invoke<const T>.nothrow<Args_t...>)
requires(invoke<const T>.able<Args_t...>){
6744 if constexpr(!invoke<T>.able<Args_t...>)
6745 template_error(
"this T can\'t becall as args.");
6746 if constexpr(was_an_ill_form(
static_cast<Ret_t
>(declvalue(T)(declvalue(Args_t)...))))
6747 template_error(
"the return type of T was wrong.");
6749 if constexpr(type_info<Ret_t> != type_info<void>)
6750 return _value(forward<Args_t>(args)...);
6752 _value(forward<Args_t>(args)...);
6754 [[nodiscard]]
auto&get_data()
noexcept{
return _value;}
6761 template<
typename Ret_t,
typename T,
typename...Args_t>
6762 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)>
6763 {
using type=Ret_t(Args_t...);};
6765 template<
typename Ret_t,
typename T,
typename...Args_t>
6766 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)&>
6767 {
using type=Ret_t(Args_t...);};
6769 template<
typename Ret_t,
typename T,
typename...Args_t>
6770 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const>
6771 {
using type=Ret_t(Args_t...);};
6773 template<
typename Ret_t,
typename T,
typename...Args_t>
6774 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const&>
6775 {
using type=Ret_t(Args_t...);};
6777 template<
typename Ret_t,
typename T,
typename...Args_t>
6778 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)noexcept>
6779 {
using type=Ret_t(Args_t...)noexcept;};
6781 template<typename Ret_t,typename T,typename...Args_t>
6782 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)&noexcept>
6783 {
using type=Ret_t(Args_t...)noexcept;};
6785 template<typename Ret_t,typename T,typename...Args_t>
6786 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const noexcept>
6787 {
using type=Ret_t(Args_t...)noexcept;};
6789 template<typename Ret_t,typename T,typename...Args_t>
6790 struct function_type_getter_helper<Ret_t(T::*)(Args_t...)const&noexcept>
6791 {
using type=Ret_t(Args_t...)noexcept;};
6793 template<typename T>
6794 [[nodiscard]]constexpr auto function_type_getter_conditional_helper(){
6795 if constexpr(::std::is_function_v<T>)
6796 return type_info<T>;
6797 elseif
constexpr(is_pointer<T> && ::std::is_function_v<::std::remove_pointer_t<T>>)
6798 return function_type_getter_conditional_helper<::std::remove_pointer_t<T>>();
6800 return type_info<type_name function_type_getter_helper<
decltype(&T::operator())>::type>;
6802 template<
typename T>
6803 struct function_type_getter{
6804 typedef decltype(function_type_getter_conditional_helper<T>())::template_name type type;
6811 template<
typename T>
6812 using get_function_type=function_type_getter<T>::type;
6818 template<
class T,
class Func_t=get_function_type<T>>
6819 class function_data_warpper_t;
6820 template<
class T,
class Ret_t,
class...Args_t>
6821 struct function_data_warpper_t<T,Ret_t(Args_t...)noexcept>{
6822 static_assert(!::std::is_function_v<T>);
6826 function_data_warpper_t(T a)
noexcept(construct<T>.nothrow<T>):_value(a){}
6827 ~function_data_warpper_t()noexcept(destruct.nothrow<T>)=default;
6828 Ret_t operator()(Args_t...args)noexcept{
6830 if constexpr(!invoke<T>.able<Args_t...>)
6831 template_error(
"this T can\'t becall as args.");
6832 if constexpr(was_an_ill_form(
static_cast<Ret_t
>(declvalue(T)(declvalue(Args_t)...))))
6833 template_error(
"the return type of T was wrong.");
6835 if constexpr(type_info<Ret_t> != type_info<void>)
6836 return _value(forward<Args_t>(args)...);
6838 _value(forward<Args_t>(args)...);
6840 Ret_t operator()(Args_t...args)const noexcept requires(invoke<const T>.able<Args_t...>){
6842 if constexpr(!invoke<T>.able<Args_t...>)
6843 template_error(
"this T can\'t becall as args.");
6844 if constexpr(was_an_ill_form(
static_cast<Ret_t
>(declvalue(T)(declvalue(Args_t)...))))
6845 template_error(
"the return type of T was wrong.");
6847 if constexpr(type_info<Ret_t> != type_info<void>)
6848 return _value(forward<Args_t>(args)...);
6850 _value(forward<Args_t>(args)...);
6852 [[nodiscard]]
auto&get_data()noexcept{
return _value;}
6858 template<
class T,
class Ret_t,
class...Args_t>
6859 struct function_data_warpper_t<T,Ret_t(Args_t...)>{
6860 static_assert(!::std::is_function_v<T>);
6864 function_data_warpper_t(T a)
noexcept(construct<T>.nothrow<T>):_value(a){}
6865 ~function_data_warpper_t()noexcept(destruct.nothrow<T>)=default;
6866 Ret_t operator()(Args_t...args)noexcept(invoke<T>.nothrow<Args_t...>){
6868 if constexpr(!invoke<T>.able<Args_t...>)
6869 template_error(
"this T can\'t becall as args.");
6870 if constexpr(was_an_ill_form(
static_cast<Ret_t
>(declvalue(T)(declvalue(Args_t)...))))
6871 template_error(
"the return type of T was wrong.");
6873 if constexpr(type_info<Ret_t> != type_info<void>)
6874 return _value(forward<Args_t>(args)...);
6876 _value(forward<Args_t>(args)...);
6878 Ret_t operator()(Args_t...args)const noexcept(invoke<const T>.nothrow<Args_t...>) requires(invoke<const T>.able<Args_t...>){
6880 if constexpr(!invoke<T>.able<Args_t...>)
6881 template_error(
"this T can\'t becall as args.");
6882 if constexpr(was_an_ill_form(
static_cast<Ret_t
>(declvalue(T)(declvalue(Args_t)...))))
6883 template_error(
"the return type of T was wrong.");
6885 if constexpr(type_info<Ret_t> != type_info<void>)
6886 return _value(forward<Args_t>(args)...);
6888 _value(forward<Args_t>(args)...);
6890 [[nodiscard]]
auto&get_data()noexcept{
return _value;}
6891 [[nodiscard]]
const auto&get_data()const noexcept{
return _value;}
6895 using function_base_n::get_function_type;
6896 using function_base_n::function_data_warpper_t;
6900 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/tools/_body.hpp"
6904 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
6909 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
6918 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
6927 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/defs.hpp"
6937 void gc_for_alloc()noexcept;
6940 using ::elc::defs::memory::gc_n::gc_for_alloc;
6944 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/default_method/defs.hpp"
6953 namespace default_method{
6955 #if defined(_MSC_VER)
6956 #if defined(ELC_TEST_CHECK_MEMORY_LACK)
6957 #pragma detect_mismatch("ELC_TEST_CHECK_MEMORY_LACK","true")
6959 #pragma detect_mismatch("ELC_TEST_CHECK_MEMORY_LACK","false")
6963 [[nodiscard]]
inline byte*base_realloc(
byte*ptr,
size_t nsize,
size_t align)
noexcept{
6964 byte*p=::elc::APIs::alloc::realloc(ptr,nsize,align);
6965 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
6967 stest_uneventlog(ptr);
6969 ELC_TEST_EVENTNAME(
"base_realloc调用");
6971 stest_uneventlog(ptr);
6977 [[nodiscard]]
inline byte*base_aligned_alloc(
size_t align,
size_t size)
noexcept{
6978 byte*p=::elc::APIs::alloc::aligned_alloc(align,size);
6979 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
6981 ELC_TEST_EVENTNAME(
"base_aligned_alloc调用");
6987 inline void base_free(
byte*p,
size_t align)
noexcept{
6989 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
6990 auto tmp=stest_geteventlistfromlog(p);
6992 stest_putsf(L
"释放了已释放或未分配指针%p,当前的事件记录如下:",p);
6993 stest_printeventlist(stderr,stest_geteventlist());
6997 stest_deleteevent(tmp);
6998 stest_uneventlog(p);
7001 ::elc::APIs::alloc::free(p,align);
7003 inline size_t base_get_size_of_alloc(
const byte*arg,
size_t align)
noexcept{
7005 const auto tmp= ::elc::APIs::alloc::get_size_of_alloc(arg,align);
7010 template<
typename T>
7011 inline void*alloc_method(type_info_t<T>)
noexcept{
7013 return ::std::assume_aligned<alignof(T)>(base_aligned_alloc(
alignof(T),
sizeof(T)));
7015 template<
typename T>
7016 inline void*alloc_method(type_info_t<T>,
size_t size)
noexcept{
7019 if constexpr(type_info<T>.has_attribute(never_in_array))
7020 template_error(
"You cannot perform array operations on never_in_array type.");
7021 return ::std::assume_aligned<alignof(T)>(base_aligned_alloc(
alignof(T),
sizeof(T)*size));
7023 template<
typename T>
7024 inline size_t get_size_of_alloc_method(
const T*arg)
noexcept{
7026 return base_get_size_of_alloc(cast_to_data(arg),
alignof(T))/
sizeof(T);
7028 template<
typename T>
7029 inline void free_method(T*arg)
noexcept{
7030 base_free(cast_to_data(arg),
alignof(T));
7032 template<
typename T>
7033 inline void*realloc_method(T*&ptr,
size_t new_size)
noexcept{
7038 if constexpr(type_info<T>.has_attribute(never_in_array))
7039 template_error(
"You cannot perform array operations on never_in_array type.");
7040 return ptr=
reinterpret_cast<T*
>(base_realloc(cast_to_data(ptr),
sizeof(T)*new_size,
alignof(T)));
7046 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/defs.hpp"
7048 enable_adl(the_alloc_method);
7049 template<
typename T>
7050 inline void*alloc_method(type_info_t<T>)
noexcept{
7052 if constexpr(was_not_an_ill_form(the_alloc_method(type_info<T>)))
7053 return the_alloc_method(type_info<T>);
7055 return default_method::alloc_method(type_info<T>);
7057 template<
typename T>
7058 inline void*alloc_method(type_info_t<T>,
size_t size)
noexcept{
7061 if constexpr(was_not_an_ill_form(the_alloc_method(type_info<T>,size)))
7062 return the_alloc_method(type_info<T>,size);
7064 return default_method::alloc_method(type_info<T>,size);
7066 enable_adl(the_get_size_of_alloc_method);
7067 template<
typename T>
7068 inline size_t get_size_of_alloc_method(
const T*arg)
noexcept{
7070 if constexpr(was_not_an_ill_form(the_get_size_of_alloc_method(arg)))
7071 return the_get_size_of_alloc_method(arg);
7073 return default_method::get_size_of_alloc_method(arg);
7075 enable_adl(the_free_method);
7076 template<
typename T>
7077 inline void free_method(T*arg)
noexcept{
7078 if constexpr(was_not_an_ill_form(the_free_method(arg)))
7079 the_free_method(arg);
7081 default_method::free_method(arg);
7083 enable_adl(the_realloc_method);
7084 template<
typename T>
7085 inline void*realloc_method(T*&ptr,
size_t new_size)
noexcept{
7090 if constexpr(was_not_an_ill_form(the_realloc_method(ptr,new_size)))
7091 return the_realloc_method(ptr,new_size);
7093 return default_method::realloc_method(ptr,new_size);
7101 [[nodiscard]]
static T*base_call()
noexcept{
7103 while(!assign(tmp,alloc_method(type_info<T>)))gc_for_alloc();
7104 return reinterpret_cast<T*
>(tmp);
7106 [[nodiscard]]
static T*base_call(
size_t size)
noexcept{
7109 template_error(
"You can\'t alloc an array for never_in_array type.");
7112 while(!assign(tmp,alloc_method(type_info<T>,size)))gc_for_alloc();
7113 return reinterpret_cast<T*
>(tmp);
7114 }
else return null_ptr;
7116 [[nodiscard]]force_inline T*operator()()
const noexcept{
return base_call();}
7117 [[nodiscard]]force_inline T*operator()(
size_t size)
const noexcept{
return base_call(size);}
7120 [[nodiscard]]force_inline T*operator()()
const noexcept{
return base_call(_size);}
7122 [[nodiscard]]force_inline
constexpr alloc_array_t operator[](
size_t a)
const noexcept{
return{a};}
7125 constexpr alloc_t<T>alloc{};
7130 static void base_call(T*p)
noexcept{
7136 force_inline
void operator()(T*p)
const noexcept{base_call(p);}
7142 static void base_call(T*&ptr,
size_t nsize)
noexcept{
7145 template_error(
"You cannot perform array operations on never_in_array type.");
7150 while(!realloc_method(ptr,nsize))gc_for_alloc();
7152 ptr=alloc<T>(nsize);
7159 force_inline
void operator()(T*&ptr,
size_t nsize)
const noexcept{
7160 base_call(ptr,nsize);
7165 [[nodiscard]]force_inline T*operator()(T*&ptr)
const noexcept{
return base_call(ptr,_size);}
7167 [[nodiscard]]force_inline
constexpr realloc_array_t operator[](
size_t a)
const noexcept{
return{a};}
7171 template<
typename T>
7172 static constexpr bool able=
true;
7173 template<
typename T>
7174 static constexpr bool nothrow=
noexcept(get_size_of_alloc_method(declvalue(
const T*)));
7176 template<
typename T>
requires able<T>
7177 static size_t base_call(
const T*arg)
noexcept(nothrow<T>){
7181 return get_size_of_alloc_method(arg);
7184 template<
typename T>
requires able<T>
7185 force_inline
size_t operator()(
const T*arg)
const noexcept(nothrow<T>){
7186 return base_call(arg);
7188 }get_size_of_alloc{};
7191 template<
typename T>
7192 static constexpr bool able=
true;
7193 template<
typename T>
7194 static constexpr bool nothrow=get_size_of_alloc.nothrow<T>;
7196 template<
typename T>
requires able<T>
7197 static T*base_call(
const T*arg)
noexcept(nothrow<T>){
7199 return alloc<T>(get_size_of_alloc(arg));
7202 template<
typename T>
requires able<T>
7203 force_inline T*operator()(
const T*arg)
const noexcept(nothrow<T>){
7204 return base_call(arg);
7211 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
7212 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_export.hpp"
7221 #define export using alloc_n::
7225 export get_size_of_alloc;
7231 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
7232 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
7233 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_test.hpp"
7242 inline void check_memory_lack()noexcept{
7243 stest_mapeventlogwith(lambda(
const void*p,steventlist*a)
noexcept{
7244 stest_putsf(L
"内存泄露于%p,分配自:",p);
7245 stest_printeventlist(stdout,stest_copyeventlist(a));
7251 #if defined(ELC_TEST_ON)
7255 ELC_TEST_EVENTNAME(
"alloc部分测试");
7259 srand((
unsigned int)time(
nullptr));
7260 for(
int i=rand()%100+40;i--;){
7261 int*p=alloc<int>(50);
7263 stest_accert(get_size_of_alloc(p)==50);
7267 stest_accert(get_size_of_alloc(p)==20);
7268 stest_accert(p[19]==666);
7269 stest_accert(p[0]==72);
7272 check_memory_lack();
7274 inline void test_log_out(){
7276 inline void test_end(){
7284 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/alloc/_body.hpp"
7289 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
7290 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7299 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/defs.hpp"
7308 namespace abstract_base_n{
7317 common_attribute_t abstract_base;
7320 using abstract_base_n::abstract_base;
7324 template<
typename T>
7325 void alloc_size_cut(T*&arg,
size_t to_size)
noexcept{
7326 realloc(arg,to_size);
7329 template<
typename T>
7330 void alloc_size_grow(T*&arg,
size_t to_size)
noexcept(move.trivial<T> or move.nothrow<T>){
7331 if constexpr(move.trivial<T>)
7332 realloc(arg,to_size);
7334 T*tmp=alloc<T>(to_size);
7335 auto from_size=get_size_of_alloc(arg);
7336 if constexpr(!move.nothrow<T>){
7337 template_warning(
"the move of T was not noexcept,this may cause memory lack.");
7339 move[from_size](note::from(arg),note::to(tmp));
7345 move[from_size](note::from(arg),note::to(tmp));
7352 template<
typename T>
7353 void alloc_size_grow_with_insert_uninitialized_data(T*&arg,
size_t insert_pos,
size_t insert_size)
noexcept(move.trivial<T> or move.nothrow<T>){
7354 const auto from_size=get_size_of_alloc(arg);
7355 const auto to_size=from_size+insert_size;
7356 const auto size_before_insert=insert_pos;
7357 const auto size_after_insert=from_size-insert_pos;
7358 if constexpr(move.trivial<T>){
7359 realloc(arg,to_size);
7360 memmove(arg+size_before_insert+insert_size,arg+size_before_insert,size_after_insert*
sizeof(T));
7363 T*tmp=alloc<T>(to_size);
7364 if constexpr(!move.nothrow<T>){
7365 template_warning(
"the move of T was not noexcept,this may cause memory lack.");
7367 move[size_before_insert](note::from(arg),note::to(tmp));
7368 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7374 move[size_before_insert](note::from(arg),note::to(tmp));
7375 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7386 template<
typename T>
7387 size_t alloc_size_grow_with_insert_uninitialized_data(T*&arg,
size_t to_size,
size_t insert_pos,
size_t insert_size)
noexcept(move.trivial<T> or move.nothrow<T>){
7388 const auto from_size=get_size_of_alloc(arg);
7389 const auto size_before_insert=insert_pos;
7390 const auto size_after_insert=from_size-insert_pos;
7391 if constexpr(move.trivial<T>){
7392 realloc(arg,to_size);
7393 memmove(arg+size_before_insert+insert_size,arg+size_before_insert,size_after_insert*
sizeof(T));
7396 T*tmp=alloc<T>(to_size);
7397 if constexpr(!move.nothrow<T>){
7398 template_warning(
"the move of T was not noexcept,this may cause memory lack.");
7400 move[size_before_insert](note::from(arg),note::to(tmp));
7401 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7407 move[size_before_insert](note::from(arg),note::to(tmp));
7408 move[size_after_insert](note::from(arg+insert_pos),note::to(tmp+insert_pos+insert_size));
7413 return to_size-from_size-insert_size;
7416 template<
typename T>
7417 void forward_alloc_size_cut(T*&arg,
size_t to_size)
noexcept(move.trivial<T> or move.nothrow<T>){
7418 const auto from_size=get_size_of_alloc(arg);
7419 const auto cut_size=from_size-to_size;
7420 if constexpr(move.trivial<T>){
7421 ::std::memmove(arg,add_const(arg+cut_size),to_size*
sizeof(T));
7422 realloc(arg,to_size);
7425 T*tmp=alloc<T>(to_size);
7426 if constexpr(!move.nothrow<T>){
7427 template_warning(
"the move of T was not noexcept,this may cause memory lack.");
7429 move[to_size](note::from(arg+cut_size),note::to(tmp));
7435 move[to_size](note::from(arg+cut_size),note::to(tmp));
7442 template<
typename T>
7443 void forward_alloc_size_grow(T*&arg,
size_t to_size)
noexcept(move.trivial<T> or move.nothrow<T>){
7444 const auto from_size=get_size_of_alloc(arg);
7445 const auto grow_size=to_size-from_size;
7446 if constexpr(move.trivial<T>){
7447 realloc(arg,to_size);
7448 ::std::memmove(arg+grow_size,add_const(arg),from_size*
sizeof(T));
7451 T*tmp=alloc<T>(to_size);
7452 if constexpr(!move.nothrow<T>){
7453 template_warning(
"the move of T was not noexcept,this may cause memory lack.");
7455 move[from_size](note::from(arg),note::to(tmp+grow_size));
7461 move[from_size](note::from(arg),note::to(tmp+grow_size));
7472 template<
typename T>
7473 size_t forward_alloc_size_grow_with_insert_uninitialized_data(T*&arg,
size_t to_size,
size_t insert_pos,
size_t insert_size)
noexcept(move.trivial<T> or move.nothrow<T>){
7474 const auto from_size=get_size_of_alloc(arg);
7475 const auto grow_size=to_size-from_size;
7476 const auto before_grow_size=grow_size-insert_size;
7477 const auto size_before_insert=insert_pos;
7478 const auto size_after_insert=from_size-insert_pos;
7479 if constexpr(move.trivial<T>){
7480 realloc(arg,to_size);
7481 const auto orogin_data_ptr=arg+before_grow_size;
7482 ::std::memmove(orogin_data_ptr+size_before_insert+insert_size,arg+size_before_insert,size_after_insert*
sizeof(T));
7483 ::std::memmove(orogin_data_ptr,arg,size_before_insert*
sizeof(T));
7486 T*tmp=alloc<T>(to_size);
7487 if constexpr(!move.nothrow<T>){
7488 template_warning(
"the move of T was not noexcept,this may cause memory lack.");
7490 const auto orogin_data_ptr=tmp+before_grow_size;
7491 move[size_before_insert](note::from(arg),note::to(orogin_data_ptr));
7492 move[size_after_insert](note::from(arg+size_before_insert),note::to(orogin_data_ptr+size_before_insert+insert_size));
7498 const auto orogin_data_ptr=tmp+before_grow_size;
7499 move[size_before_insert](note::from(arg),note::to(orogin_data_ptr));
7500 move[size_after_insert](note::from(arg+size_before_insert),note::to(orogin_data_ptr+size_before_insert+insert_size));
7505 return before_grow_size;
7509 template<
typename T>
7512 template<
class...Args>
7513 static constexpr bool able=construct<T>.able<Args...>&&destruct.able<T>;
7514 template<
class...Args>
7515 static constexpr bool nothrow=construct<T>.nothrow<Args...>;
7517 template<
class...Args>
requires able<Args...>
7518 [[nodiscard]]T* operator()(Args&&...rest)
const noexcept(nothrow<Args...>){
7520 return construct<T>[alloc<T>()](forward<Args>(rest)...);
7525 template<
class...Args>
requires able<Args...>
7526 [[nodiscard]]T* operator()(Args&&...rest)
const noexcept(nothrow<Args...>){
7529 template_error(
"You can\'t get an array for never_in_array type.");
7530 return construct<T>[alloc<T>(_size)][_size](forward<Args>(rest)...);
7533 [[nodiscard]]
constexpr array_get_t operator[](
size_t size)
const noexcept{
return{size};}
7536 template<
typename U>
7537 static constexpr bool able=copy_construct.able<T>&&destruct.able<T>&&is_array_like_for<T,U>;
7538 template<
typename U>
7539 static constexpr bool nothrow=copy_construct.nothrow<T>;
7544 template_error(
"You can\'t get an array for never_in_array type.");
7546 auto aret=alloc<T>[size]();
7547 copy_construct[size](note::from(a.begin()),note::to(aret));
7553 template<
typename U>
7554 static constexpr bool able=copy_construct.able<T>&&move.able<T>&&is_array_like_for<T,U>;
7555 template<
typename U>
7556 static constexpr bool nothrow=copy_construct.nothrow<T>&&move.nothrow<T>;
7561 auto from_size=get_size_of_alloc(ptr);
7562 auto a_size=a.size();
7563 alloc_size_grow(ptr,from_size+a_size);
7564 copy_construct[a_size](note::from(a.begin()),note::to(ptr+from_size));
7567 T* operator()(
note::to_t<T*&> to,
const T&a)
const noexcept(nothrow<void>){
7570 auto from_size=get_size_of_alloc(ptr);
7571 alloc_size_grow(ptr,from_size+1);
7572 copy_construct(note::from(&a),note::to(ptr+from_size));
7578 auto from_size=get_size_of_alloc(ptr);
7579 alloc_size_grow(ptr,from_size+1);
7580 move_construct(note::from(&a),note::to(ptr+from_size));
7586 template<
typename U>
7587 static constexpr bool able=destruct.able<T>&&move.able<T>&&is_array_like_for<T,U>;
7588 template<
typename U>
7589 static constexpr bool nothrow=destruct.nothrow<T>&&move.nothrow<T>;
7593 auto ptr=from.value;
7594 auto from_size=get_size_of_alloc(ptr);
7595 T*ptr_to_a=in_range(a,{ptr,note::size(from_size)});
7596 auto a_size=a.size();
7600 destruct[a_size](ptr_to_a);
7601 move[(ptr+from_size)-(ptr_to_a+a_size)](note::from(ptr_to_a+a_size),note::to(ptr_to_a));
7602 alloc_size_cut(ptr,from_size-a_size);
7607 template<
typename T>
7608 constexpr get_t<T>get{};
7612 template<
typename T>
7613 static constexpr bool able=destruct.able<T>;
7614 template<
typename T>
7615 static constexpr bool nothrow=destruct.nothrow<T>;
7617 template<
typename T>
requires able<T>
7618 void operator()(T*a)
const noexcept(nothrow<T>){
7622 #
if defined(_MSC_VER)
7623 [[gsl::suppress(f.6)]]
7625 attribute_ptr_cast<abstract_base>(a)->abstract_method_unget_this();
7627 if constexpr(!destruct.nothrow<T>)
7628 template_warning(
"the destructer of T was not noexcept,this may cause memory lack.");
7632 destruct[get_size_of_alloc(a)](a);
7638 template<
typename T>
requires able<T>
7639 void operator()(T*a,
decltype(destruct)::not_t)
const noexcept(nothrow<T>){
7646 template<
typename T>
7647 static constexpr bool able=construct<T>.able<>&&destruct.able<T>&&move.able<T>;
7648 template<
typename T>
7649 static constexpr bool nothrow=type_info<T>.not_has_attribute(
abstract_base)&&construct<T>.nothrow<>&&destruct.nothrow<T>&&move.nothrow<T>;
7651 template<
typename T>
requires able<T>
7652 static void base_call(T*&arg,
const size_t to_size)
noexcept(nothrow<T>){
7654 template_warning(
"For never_in_array type,get_resize will unget ptr when new_size=0 else do nothing.");
7659 }elseif
constexpr(type_info<T>.has_attribute(
abstract_base)){
7660 arg=attribute_ptr_cast<abstract_base>(arg)->abstract_method_get_resize_this(to_size);
7662 const size_t from_size=get_size_of_alloc(arg);
7663 if(from_size==to_size)
7665 elseif(from_size > to_size){
7666 destruct[from_size-to_size](arg+to_size);
7667 alloc_size_cut(arg,to_size);
7669 alloc_size_grow(arg,to_size);
7670 construct<T>[arg+from_size][to_size-from_size]();
7672 arg=get<T>[to_size]();
7676 template<
typename T>
requires able<T>
7677 inline void operator()(T*&arg,
size_t to_size)
const noexcept(nothrow<T>){
7679 base_call(arg,to_size);
7681 template<
typename T>
requires able<T>
7682 [[nodiscard]]
inline T* operator()(T*&&arg,
size_t to_size)
const noexcept(nothrow<T>){
7684 base_call(arg,to_size);
7689 template<
typename T>
7690 static constexpr bool able=get_resize_t::able<T>;
7691 template<
typename T>
7692 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7693 template<
typename T>
requires(able<T> && construct<T>.able<>)
7694 void operator()(T*&arg,
size_t insert_pos,
size_t insert_size)
const noexcept(nothrow<T>){
7697 alloc_size_grow_with_insert_uninitialized_data(arg,insert_pos,insert_size);
7698 construct<T>[arg+insert_pos][insert_size]();
7701 template<
typename T>
requires(able<T> && copy_construct.able<T>)
7702 void operator()(T*&arg,
size_t insert_pos,
size_t insert_size,
const T*insert_data)
const noexcept(nothrow<T>){
7705 alloc_size_grow_with_insert_uninitialized_data(arg,insert_pos,insert_size);
7706 copy_construct[insert_size](note::from(insert_data),note::to(arg+insert_pos));
7711 template<
typename T>
7712 static constexpr bool able=get_resize_t::able<T>;
7713 template<
typename T>
7714 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7715 template<
typename T>
requires(able<T> && construct<T>.able<> && copy_construct.able<T>)
7716 void operator()(T*&arg,
size_t insert_pos,
size_t insert_size,
const T*insert_data,
size_t to_size)
const noexcept(nothrow<T>){
7718 auto end_grow_size=alloc_size_grow_with_insert_uninitialized_data(arg,to_size,insert_pos,insert_size);
7719 copy_construct[insert_size](note::from(insert_data),note::to(arg+insert_pos));
7720 construct<T>[arg+to_size-end_grow_size][end_grow_size]();
7722 }insert_with_resize{};
7726 template<
typename T>
7727 static constexpr bool able=construct<T>.able<>&&destruct.able<T>&&move.able<T>;
7728 template<
typename T>
7729 static constexpr bool nothrow=type_info<T>.not_has_attribute(
abstract_base)&&construct<T>.nothrow<>&&destruct.nothrow<T>&&move.nothrow<T>;
7731 template<
typename T>
requires able<T>
7732 static void base_call(T*&arg,
const size_t to_size)
noexcept(nothrow<T>){
7735 template_warning(
"For never_in_array type,get_forward_resize will unget ptr when new_size=0 else do nothing.");
7740 }elseif
constexpr(type_info<T>.has_attribute(
abstract_base)){
7741 arg=attribute_ptr_cast<abstract_base>(arg)->abstract_method_get_forward_resize_this(to_size);
7743 const size_t from_size=get_size_of_alloc(arg);
7744 if(from_size==to_size)
7746 elseif(from_size > to_size){
7747 destruct[from_size-to_size](arg);
7748 forward_alloc_size_cut(arg,to_size);
7750 forward_alloc_size_grow(arg,to_size);
7751 construct<T>[arg][to_size-from_size]();
7753 arg=get<T>[to_size]();
7757 template<
typename T>
requires able<T>
7758 inline void operator()(T*&arg,
size_t to_size)
const noexcept(nothrow<T>){
7759 base_call(arg,to_size);
7761 template<
typename T>
requires able<T>
7762 [[nodiscard]]
inline T* operator()(T*&&arg,
size_t to_size)
const noexcept(nothrow<T>){
7763 base_call(arg,to_size);
7768 template<
typename T>
7769 static constexpr bool able=get_resize_t::able<T>;
7770 template<
typename T>
7771 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7772 template<
typename T>
requires(able<T> && construct<T>.able<>)
7773 void operator()(T*&arg,
size_t insert_pos,
size_t insert_size)
const noexcept(nothrow<T>){
7775 get_resize.insert(arg,insert_pos,insert_size);
7777 template<
typename T>
requires(able<T> && copy_construct.able<T>)
7778 void operator()(T*&arg,
size_t insert_pos,
size_t insert_size,
const T*insert_data)
const noexcept(nothrow<T>){
7780 get_resize.insert(arg,insert_pos,insert_size,insert_data);
7784 template<
typename T>
7785 static constexpr bool able=get_resize_t::able<T>;
7786 template<
typename T>
7787 static constexpr bool nothrow=get_resize_t::nothrow<T>;
7788 template<
typename T>
requires(able<T> && construct<T>.able<> && copy_construct.able<T>)
7789 void operator()(T*&arg,
size_t insert_pos,
size_t insert_size,
const T*insert_data,
size_t to_size)
const noexcept(nothrow<T>){
7792 auto before_grow_size=forward_alloc_size_grow_with_insert_uninitialized_data(arg,to_size,insert_pos,insert_size);
7793 const auto orogin_arg=arg+before_grow_size;
7794 copy_construct[insert_size](note::from(insert_data),note::to(orogin_arg+insert_pos));
7795 construct<T>[arg][before_grow_size]();
7798 }insert_with_resize{};
7799 }get_forward_resize{};
7802 template<
typename T>
7803 static constexpr bool able=
true;
7804 template<
typename T>
7805 static constexpr bool nothrow=
noexcept(get_size_of_alloc(declvalue(
const T*)));
7807 template<
typename T>
requires able<T>
7808 static size_t base_call(
const T*arg)
noexcept(nothrow<T>){
7810 return get_size_of_alloc(arg);
7813 template<
typename T>
requires able<T>
7814 size_t operator()(
const T*arg)
const noexcept(nothrow<T>){
7815 return base_call(arg);
7820 template<
typename T>
7821 static constexpr bool able=copy_construct.able<T> || type_info<T>.has_attribute(
abstract_base);
7822 template<
typename T>
7823 static constexpr bool nothrow=copy_construct.nothrow<T>;
7825 template<
typename T>
requires able<T>
7826 static T*base_call(
const T*arg)
noexcept(nothrow<T>){
7829 return remove_const(attribute_ptr_cast<abstract_base>(arg))->abstract_method_copy_get_this();
7831 return copy_construct(note::from(arg),note::to(copy_alloc(arg)),get_size_of_get(arg));
7834 template<
typename T>
requires able<T>
7835 T*operator()(
const T*arg)
const noexcept(nothrow<T>){
7836 return base_call(arg);
7843 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7844 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_export.hpp"
7853 #define export using get_n::
7856 export get_forward_resize;
7858 export get_size_of_get;
7865 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7866 #if defined(ELC_TEST_ON)
7867 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_test.hpp"
7879 ELC_TEST_EVENTNAME(
"get部分测试");
7881 ste::tester::setzero();
7882 tester*p=get<tester>[50]();
7883 stest_accert(tester::getbuildtime()==50);
7886 stest_accert(tester::getdestroytime()==50);
7887 stest_accert(tester::getbuildtime()==60);
7892 stest_accert(tester::getcalltime()==60);
7895 stest_accert(tester::getdestroytime()==110);
7897 check_memory_lack();
7899 inline void test_log_out(){
7901 inline void test_end(){
7908 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/get/_body.hpp"
7913 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
7914 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
7924 namespace abstract_base_n{
7933 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/pointer_off_set.hpp"
7942 inline thread_local pointer base_ptr;
7943 inline thread_local ptrdiff_t off_set;
7944 distinctive
inline void is_base_ptr(
void*a)
noexcept{base_ptr=a;}
7945 distinctive
inline void is_instance_ptr(
void*a)
noexcept{off_set=get_off_set(note::from(a),note::to(base_ptr));}
7946 distinctive
inline void*get_ptr_after_off_set(
void*a)
noexcept{
return apply_off_set(a,off_set);}
7950 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
7951 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/abstract_base_vtable.hpp"
7962 virtual void* _abstract_method_copy_get_this()=0;
7963 virtual void* _abstract_method_get_resize_this(
size_t size)=0;
7964 virtual void* _abstract_method_get_forward_resize_this(
size_t size)=0;
7966 virtual void abstract_method_unget_this()=0;
7967 virtual size_t abstract_method_get_size_of_get_for_this()
noexcept=0;
7977 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
7978 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/abstract_base.hpp"
7989 T* abstract_method_copy_get_this(){
7991 return reinterpret_cast<T*
>(get_ptr_after_off_set(this->_abstract_method_copy_get_this()));
7993 T* abstract_method_get_resize_this(
size_t size){
7995 return reinterpret_cast<T*
>(get_ptr_after_off_set(this->_abstract_method_get_resize_this(size)));
7997 T* abstract_method_get_forward_resize_this(
size_t size){
7999 return reinterpret_cast<T*
>(get_ptr_after_off_set(this->_abstract_method_get_forward_resize_this(size)));
8010 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
8011 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/instance_struct.hpp"
8020 push_and_disable_msvc_warning(26436);
8024 virtual void abstract_method_unget_this()noexcept_as(unget(get_handle(
this)))
override{unget(get_handle(
this));}
8025 virtual void* _abstract_method_copy_get_this()
noexcept(copy_get.able<T>?copy_get.nothrow<T>:1)
override{
8026 if constexpr(copy_get.able<T>){
8027 is_instance_ptr(
this);
8028 return copy_get(get_handle(
this));
8031 return get_handle(
this);
8034 virtual void* _abstract_method_get_resize_this(
size_t size)
noexcept(get_resize.able<T>?get_resize.nothrow<T>:1)
override{
8035 if constexpr(get_resize.able<T>){
8036 is_instance_ptr(
this);
8037 return get_resize(get_handle(
this),size);
8040 return get_handle(
this);
8043 virtual void* _abstract_method_get_forward_resize_this(
size_t size)
noexcept(get_forward_resize.able<T>?get_forward_resize.nothrow<T>:1)
override{
8044 if constexpr(get_forward_resize.able<T>){
8045 is_instance_ptr(
this);
8046 return get_forward_resize(get_handle(
this),size);
8049 return get_handle(
this);
8052 virtual size_t abstract_method_get_size_of_get_for_this()
noexcept override{
return get_size_of_get(get_handle(
this));}
8058 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
8060 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_export.hpp"
8069 #define export using abstract_base_n::
8070 export abstract_base;
8071 export instance_struct;
8076 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/abstract_base/_body.hpp"
8080 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8084 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8093 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/defs.hpp"
8102 template<
typename T>
8105 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8114 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/ref_t.hpp"
8123 typedef ::std::size_t link_num_t;
8125 mutable link_num_t _ref_num=0;
8127 constexpr ref_t()
noexcept=
default;
8129 constexpr inline void add_ref()
const noexcept{_ref_num++;}
8130 [[nodiscard]]
inline bool cut_ref()
const noexcept{
return!--_ref_num;}
8132 inline void set_zero()
noexcept{_ref_num=0;}
8133 constexpr inline void init_never_ref_num_zero()
noexcept{add_ref();}
8134 [[nodiscard]]link_num_t link_num()
const noexcept{
return _ref_num;}
8139 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8140 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/ref_base.hpp"
8149 enable_adl(the_waiting_for_destroy);
8150 template<
typename T>
8151 void waiting_for_destroy(T*a)
noexcept{
8152 if constexpr(was_not_an_ill_form(the_waiting_for_destroy(a)))
8153 return the_waiting_for_destroy(a);
8155 template_error(
"this function should not be instantiated,please overload the function the_waiting_for_destroy in the namespace where this type is defined.");
8157 enable_adl(the_destroy_and_free);
8158 template<
typename T>
8159 void destroy_and_free(T*a)
noexcept{
8160 if constexpr(was_not_an_ill_form(the_destroy_and_free(a)))
8161 return the_destroy_and_free(a);
8165 template_error(
"please overload the function the_destroy_and_free in the namespace where this type is defined.");
8168 common_attribute_t ref_able;
8169 common_attribute_t weak_ref_able;
8171 template<
typename T>
8172 constexpr bool was_ref_able=type_info<T>.has_attribute(ref_able);
8173 template<
typename T>
8174 constexpr bool was_weak_ref_able=type_info<T>.has_attribute(weak_ref_able);
8176 template<
typename T>
8177 [[nodiscard]]link_num_t get_ref_num(
const T*a)
noexcept{
8178 if constexpr(!was_ref_able<T>)
8179 template_error(
"hey.");
8180 return attribute_ptr_cast<const ref_able>(a)->link_num();
8182 template<
typename T>
8183 [[nodiscard]]link_num_t get_weak_ref_num(
const T*a)
noexcept{
8184 if constexpr(!was_weak_ref_able<T>)
8185 template_error(
"hey.");
8186 return attribute_ptr_cast<const weak_ref_able>(a)->link_num();
8191 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8192 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/ref_able.hpp"
8201 template<
typename T>
8206 using base_t::base_t;
8207 inline void cut_ref()
const noexcept{
8208 T*this_T=remove_const(get_handle(
this));
8209 if(base_t::cut_ref())
8210 if constexpr(was_weak_ref_able<T>)
8211 if(get_weak_ref_num(this_T)!=0)
8212 waiting_for_destroy(this_T);
8214 destroy_and_free(this_T);
8216 destroy_and_free(this_T);
8222 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8223 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/weak_ref_able.hpp"
8232 template<
typename T>
8237 inline void cut_ref()
const noexcept{
8238 if constexpr(!was_ref_able<T>)
8239 template_error(
"base on ref_able before base on weak_ref_able,please.");
8240 T*this_T=remove_const(get_handle(
this));
8241 if(base_t::cut_ref())
8242 if(get_ref_num(this_T)==0)
8243 destroy_and_free(this_T);
8249 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ref/_body.hpp"
8253 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/defs.hpp"
8254 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8263 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/base_ptr_t.hpp"
8280 [[nodiscard]]T*get()
const noexcept{
return _to;}
8282 template<
class T,
typename ref_type>
8288 void swap_with(
same_ref_p_t&a)
noexcept{swap(_to,a._to);}
8290 static constexpr bool cut_nothrow=
noexcept(declvalue(ref_type).cut_ref());
8292 static void cut_ref(T*a)
noexcept(cut_nothrow){attribute_ptr_cast<ref_type>(a)->cut_ref();}
8293 static void add_ref(T*a)
noexcept{attribute_ptr_cast<ref_type>(a)->add_ref();}
8295 void cut_ref()
const noexcept_as(cut_ref(
nullptr)){cut_ref(_to);}
8296 void add_ref()
const noexcept{add_ref(_to);}
8299 template<
class T,
typename ref_type>
8304 template<
class T,
typename ref_type,
bool do_replace_check>
8311 using base_t::cut_nothrow;
8312 using same_ref::add_ref;
8313 using same_ref::cut_ref;
8314 using same_ref::swap_with;
8315 using same_ptr::_to;
8320 if constexpr(type_info<T>.has_attribute(
weak_ref_able) && type_info<ref_type> == type_info<ref_able<remove_cv<T>>>)
8321 if(get_ref_num(_to))
8324 add_ref(_to=null_ptr);
8330 ptr_t(
const ptr_t<remove_cv<T>,ref_type,do_replace_check>&a)
noexcept requires(type_info<remove_cv<T>>!=type_info<T>):
ptr_t(a.get()){}
8347 constexpr ptr_t(nullptr_t=
nullptr)
noexcept:
ptr_t(null_ptr){}
8348 constexpr ptr_t(null_ptr_t)
noexcept:
ptr_t((T*)(null_ptr)){}
8349 ~ptr_t()
noexcept(cut_nothrow){cut_ref();}
8351 static constexpr bool reset_nothrow=cut_nothrow;
8352 void reset(T*a)
const noexcept(reset_nothrow){
auto tmp=_to;add_ref(_to=a);cut_ref(tmp);}
8353 void reset(nullptr_t=
nullptr)
const noexcept(reset_nothrow){reset(null_ptr);}
8355 static constexpr bool replace_check_nothrow=(type_info<T>.not_has_attribute(
replace_able))||reset_nothrow;
8356 inline void replace_check()
const noexcept(replace_check_nothrow){
8357 if constexpr(do_replace_check&&type_info<remove_cvref<T>>.has_attribute(
replace_able))
8358 if(attribute_ptr_cast<replace_able>(_to)->replaced())
8359 reset(attribute_ptr_cast<replace_able>(_to)->get_ptr());
8361 inline void do_replace(T*p)
noexcept(replace_check_nothrow&&reset_nothrow){
8362 if constexpr(type_info<remove_cvref<T>>.has_attribute(
replace_able)){
8363 attribute_ptr_cast<replace_able>(_to)->be_replace_as(p);
8367 template<
typename ref_type_,
bool do_replace_check_>
8369 do_replace(p.get());
8371 static constexpr bool get_nothrow=replace_check_nothrow;
8372 [[nodiscard]]T*get()
const noexcept(get_nothrow){
8374 return base_t::get();
8376 [[nodiscard]]
bool unique()
const noexcept{
return attribute_ptr_cast<ref_able>(get())->link_num()==1;}
8377 [[nodiscard]]
constexpr
8378 conditional<do_replace_check&&type_info<T>.has_attribute(
replace_able),
8380 using elc::defs::hash;
8384 [[nodiscard]]
inline auto operator==(
const T*a)
const noexcept_as(pointer_equal(add_const(declvalue(
const this_t&).get()),a)){
8385 return pointer_equal(add_const(get()),a);
8387 [[nodiscard]]
inline auto operator==(nullptr_t)
const noexcept_as(
operator==(null_ptr)){
8388 return operator==(null_ptr);
8390 [[nodiscard]]
inline auto operator==(null_ptr_t)
const noexcept_as(
operator==((T*)null_ptr)){
8391 return operator==((T*)null_ptr);
8393 template<
typename ref_type_,
bool do_replace_check_>
8395 noexcept_as(pointer_equal(
8396 declvalue(
const this_t&).get(),
8399 return pointer_equal(get(),b.get());
8401 template<
typename ref_type_,
bool do_replace_check_>
requires(type_info<remove_cv<T>>!=type_info<T>)
8403 noexcept_as(pointer_equal(
8404 declvalue(
const this_t&).get(),
8407 return pointer_equal(get(),b.get());
8409 template<
typename ref_type_,
bool do_replace_check_>
requires(type_info<remove_cv<T>>!=type_info<T>)
8410 [[nodiscard]]
inline auto operator==(
const ptr_t<remove_cv<T>,ref_type_,do_replace_check_>&b)
const
8411 noexcept_as(pointer_equal(
8412 declvalue(
const this_t&).get(),
8415 return pointer_equal(get(),add_const(b.get()));
8419 template<
typename T_,
typename T,
typename ref_type,
bool do_replace_check,enable_if(type_info<T_>.base_on<T>)>
8421 return b.operator==(
static_cast<const T*
>(a));
8424 template<
typename T,
typename T_>
requires(equal.able<T,T_>)
8425 [[nodiscard]]
inline auto operator!=(T&&a,T_&&b)noexcept_as(!(a==b)){
8429 template<
class T,
typename ref_type,
bool do_replace_check>
8431 static_assert(type_info<T>.base_on<ref_type>);
8436 using base_t::reset;
8438 using same_ref::swap_with;
8439 using same_ptr::_to;
8441 using base_t::get_nothrow;
8442 using base_t::reset_nothrow;
8449 [[nodiscard]]T*operator->()
const noexcept(get_nothrow){
return get();}
8450 [[nodiscard]]T&operator*()
const noexcept(get_nothrow){
return*get();}
8451 [[nodiscard]]
explicit operator bool()
const noexcept(get_nothrow){
return bool(pointer_to_bool(get()));}
8452 [[nodiscard]]
auto operator!()
const noexcept(get_nothrow){
return!pointer_to_bool(get());}
8453 [[nodiscard]]
explicit operator T*()
const noexcept(get_nothrow){
return get();}
8455 base_ptr_t&operator=(T*a)&
noexcept(reset_nothrow){reset(a);
return*
this;}
8456 base_ptr_t&operator=(
const same_ptr&a)&
noexcept(reset_nothrow&&get_nothrow){reset(a.get());
return*
this;}
8457 base_ptr_t&operator=(
const base_ptr_t&a)&
noexcept(reset_nothrow&&get_nothrow){reset(a.get());
return*
this;}
8460 base_ptr_t&operator=(null_ptr_t)&
noexcept(reset_nothrow){
return*
this=(T*)null_ptr;}
8461 base_ptr_t&operator=(nullptr_t)&
noexcept(reset_nothrow){
return*
this=null_ptr;}
8464 static inline thread_local class for_delete_t{
8467 for_delete_t*operator()(T*a)
noexcept{
8472 static void operator delete(
void*a)noexcept_as(destroy(declvalue(T*))){
8473 destroy(
reinterpret_cast<for_delete_t*
>(a)->_m);
8477 [[nodiscard]]
explicit operator bool()
noexcept(get_nothrow){
return add_const(
this)->operator bool();}
8478 [[nodiscard]]distinctive
operator for_delete_t*()
noexcept(get_nothrow){
return for_delete(get());}
8480 template<
typename...Args>
requires(invoke<T>.able<Args...>)
8481 inline auto operator()(Args&&... rest)
noexcept(invoke<T>.nothrow<Args...>){
return(
operator*())(forward<Args>(rest)...);}
8486 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8487 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/comn_ptr_t.hpp"
8496 template<
typename T>
8501 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8502 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/weak_ptr_t.hpp"
8511 template<
typename T>
8516 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8517 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/nocheck_ptr_t.hpp"
8526 template<
typename T>
8531 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8532 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/deduction_guides.hpp"
8541 template<
class T,common_attribute_t ref_type,
bool has_check>
8544 template<
class T,common_attribute_t ref_type,
bool has_check>
8549 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/ptr/_body.hpp"
8553 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/defs.hpp"
8558 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8559 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_export.hpp"
8568 #define export using ptr_n::
8570 export weak_ref_able;
8578 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8579 #if defined(ELC_TEST_ON)
8580 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_test.hpp"
8591 with_common_attribute<ref_able,weak_ref_able,never_in_array>,
build_by_get_only{};
8592 void waiting_for_destroy(tester*)
noexcept{}
8594 ELC_TEST_EVENTNAME(
"ptr部分测试");
8596 comn_ptr_t a=get<tester>();
8599 check_memory_lack();
8601 inline void test_log_out(){
8603 inline void test_end(){
8609 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/ptr/_body.hpp"
8614 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8616 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/_body.hpp"
8625 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/replace_able.hpp"
8635 template<
typename T>
8640 constexpr replace_able()
noexcept:_m(get_handle(
this)){}
8643 attribute_ptr_cast<ref_able>(_m)->cut_ref();
8645 constexpr bool replaced()
const noexcept{
return _m!=get_handle(
this);}
8646 constexpr T*get_ptr()
const noexcept{
8650 return attribute_ptr_cast<replace_able>(_m)->get_ptr();
8652 constexpr void be_replace_as(T*new_p)
noexcept{
8654 attribute_ptr_cast<ref_able>(_m)->cut_ref();
8657 attribute_ptr_cast<ref_able>(_m)->add_ref();
8659 constexpr void be_replace_as(nullptr_t)
noexcept{be_replace_as(null_ptr);}
8664 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/_body.hpp"
8666 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/can_map_all.hpp"
8675 template<
typename T>
8681 template<
class,
class func_t>
8682 friend inline void map_all_helper(func_t&&a);
8685 type_list.add(
this);
8688 template<
class T,
class func_t>
8689 inline void map_all_helper(func_t&&a){
8693 a(get_handle<T,can_map_all>(tmp++));
8696 #define expr declvalue(func_t)(declvalue(T*))
8697 template<
class T,
class func_t,enable_if(was_not_an_ill_form(expr))>
8698 inline void map_all(func_t&&a)noexcept_as(expr){
8699 map_all_helper<T,func_t>(forward<func_t>(a));
8705 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/other/_body.hpp"
8709 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8713 #if defined(ELC_TEST_ON)
8714 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_test.hpp"
8724 ELC_TEST_EVENTNAME(
"memory部分测试");
8730 inline void test_log_out(){
8731 alloc_n::test_log_out();
8732 lifetime_n::test_log_out();
8733 get_n::test_log_out();
8736 inline void test_end(){
8737 alloc_n::test_end();
8738 lifetime_n::test_end();
8745 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/_body.hpp"
8750 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
8752 using namespace memory;
8754 namespace container{
8755 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
8764 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
8773 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/defs.hpp"
8783 template<
typename T>
8787 #if defined(DEBUG) || defined(_DEBUG)
8788 size_t _size_for_debug_view=0;
8791 #if defined(DEBUG) || defined(_DEBUG)
8793 constexpr array_t(T*a,
size_t s):_m(a),_size_for_debug_view(s){}
8796 constexpr array_t(T*a):_m(a){}
8799 [[nodiscard]]
this_t copy()
const noexcept(copy_get.nothrow<T>)
requires(copy_get.able<T>){
8800 #if defined(DEBUG) || defined(_DEBUG)
8801 return{copy_get(_m),_size_for_debug_view};
8803 return{copy_get(_m)};
8807 void swap_with(
this_t&a)
noexcept{
8809 #if defined(DEBUG) || defined(_DEBUG)
8810 swap(_size_for_debug_view,a._size_for_debug_view);
8815 constexpr array_t()
noexcept:_m(null_ptr){}
8820 _m=get<T>[size.value]();
8821 #if defined(DEBUG) || defined(_DEBUG)
8822 _size_for_debug_view=size.value;
8826 _m=get<T>[size.value](elem);
8827 #if defined(DEBUG) || defined(_DEBUG)
8828 _size_for_debug_view=size.value;
8835 template<
class U>
requires(get<T>.as_array.able<U>)
8836 array_t(U&&a)
noexcept(get<T>.as_array.nothrow<U>){
8837 _m=get<T>.as_array(forward<U>(a));
8838 #if defined(DEBUG) || defined(_DEBUG)
8839 _size_for_debug_view=size();
8846 return operator=(a.copy());
8854 ~array_t()
noexcept(unget.nothrow<T>){
8857 [[nodiscard]]
size_t size()
const noexcept{
8858 return get_size_of_get(_m);
8860 [[nodiscard]]
size_t size_in_byte()
const noexcept{
8861 return size()*
sizeof(T);
8863 static constexpr bool resize_nothrow = get_resize.nothrow<T>;
8864 void resize(
size_t size)
noexcept(resize_nothrow){
8865 get_resize(_m,size);
8866 #if defined(DEBUG) || defined(_DEBUG)
8867 _size_for_debug_view=size;
8870 static constexpr bool forward_resize_nothrow = get_forward_resize.nothrow<T>;
8871 void forward_resize(
size_t size)
noexcept(forward_resize_nothrow){
8872 get_forward_resize(_m,size);
8873 #if defined(DEBUG) || defined(_DEBUG)
8874 _size_for_debug_view=size;
8877 static constexpr bool insert_nothrow = get_resize.insert.nothrow<T>;
8878 void insert(
size_t index,
size_t count)
noexcept(insert_nothrow){
8879 get_resize.insert(_m,index,count);
8880 #if defined(DEBUG) || defined(_DEBUG)
8881 _size_for_debug_view+=count;
8884 void insert(
size_t index,
size_t count,
const T*data)
noexcept(insert_nothrow){
8885 get_resize.insert(_m,index,count,data);
8886 #if defined(DEBUG) || defined(_DEBUG)
8887 _size_for_debug_view+=count;
8890 void insert_with_resize(
size_t index,
size_t count,
const T*data,
size_t new_size)
noexcept(insert_nothrow){
8891 get_resize.insert_with_resize(_m,index,count,data,new_size);
8892 #if defined(DEBUG) || defined(_DEBUG)
8893 _size_for_debug_view=new_size;
8896 static constexpr bool insert_with_forward_resize_nothrow = get_forward_resize.insert_with_resize.nothrow<T>;
8897 void insert_with_forward_resize(
size_t index,
size_t count,
const T*data,
size_t new_size)
noexcept(insert_with_forward_resize_nothrow){
8898 get_forward_resize.insert_with_resize(_m,index,count,data,new_size);
8899 #if defined(DEBUG) || defined(_DEBUG)
8900 _size_for_debug_view=new_size;
8903 [[nodiscard]]
bool empty()
const{
8904 return _m==null_ptr;
8906 void clear()
noexcept(re_construct.nothrow<
this_t>){
8909 [[nodiscard]]T&operator[](
size_t pos)
noexcept{
return _m[pos];}
8910 [[nodiscard]]
const T&operator[](
size_t pos)
const noexcept{
return _m[pos];}
8911 [[nodiscard]]
explicit operator hash_t()
const noexcept(hash.nothrow<T>){
return hash(_m,size());}
8912 [[nodiscard]]
explicit operator T*()
noexcept{
return _m;}
8913 [[nodiscard]]
explicit operator const T*()
const noexcept{
return _m;}
8915 typedef iterator_t<T>iterator;
8916 typedef const_iterator_t<T>const_iterator;
8918 [[nodiscard]]
constexpr iterator get_iterator_at(
size_t a)
noexcept{
8921 [[nodiscard]]
constexpr const_iterator get_iterator_at(
size_t a)
const noexcept{
8924 [[nodiscard]]
constexpr iterator begin()
noexcept{
8925 return get_iterator_at(zero);
8927 [[nodiscard]]iterator end()
noexcept{
8928 return get_iterator_at(size());
8930 [[nodiscard]]
constexpr const_iterator begin()
const noexcept{
8931 return get_iterator_at(zero);
8933 [[nodiscard]]const_iterator end()
const noexcept{
8934 return get_iterator_at(size());
8936 [[nodiscard]]const_iterator cbegin()
const noexcept{
8939 [[nodiscard]]const_iterator cend()
const noexcept{
8956 #define expr declvalue(func_t)(declvalue(T&))
8957 template<
typename func_t>
requires was_not_an_ill_form(expr)
8958 void for_each(func_t&&func)noexcept_as(expr){
8961 func((*
this)[asize]);
8965 #define expr declvalue(func_t)(declvalue(const T&))
8966 template<
typename func_t>
requires was_not_an_ill_form(expr)
8967 void for_each(func_t&&func)
const noexcept_as(expr){
8970 func((*
this)[asize]);
8974 void push_back(
const T&a){
8975 get<T>.apply_end(note::to<T*&>(_m),a);
8976 #if defined(DEBUG) || defined(_DEBUG)
8977 _size_for_debug_view=size();
8980 void push_back(T&&a){
8981 get<T>.apply_end(note::to<T*&>(_m),move(a));
8982 #if defined(DEBUG) || defined(_DEBUG)
8983 _size_for_debug_view=size();
8987 get<T>.remove(a,note::from(_m));
8988 #if defined(DEBUG) || defined(_DEBUG)
8989 _size_for_debug_view=size();
8993 template<
class U,enable_if(get<T>.apply_end.able)>
8994 friend this_t&operator+=(
this_t&a,U&&b)
noexcept(get<T>.apply_end.nothrow<U>){
8995 get<T>.apply_end(note::to(a._m),b);
9001 template<
typename U>
9002 friend this_t operator+(
const this_t&a,U&&b)noexcept_as(a.copy()+=b)
requires was_not_an_ill_form(a.copy()+=b){
9005 template<
typename U>
9010 template<
typename U>
9011 this_t&& operator+(U&& b)&&noexcept_as(*
this+=b)
requires was_not_an_ill_form(*
this+=b){
9016 template<
typename U>
9017 [[nodiscard]]iterator find(U&&a)
noexcept requires was_not_an_ill_form(in_range(declvalue(
this_t),a)){
9018 return in_range(*
this,a);
9020 template<
typename U>
9021 [[nodiscard]]const_iterator find(U&&a)
const noexcept requires was_not_an_ill_form(in_range(declvalue(
this_t),a)){
9022 return in_range(*
this,a);
9025 template<
typename T>
9029 [[nodiscard]]
inline auto size_of_array_like(
const array_t<remove_cv<T>>&a)
noexcept{
return a.size();}
9031 [[nodiscard]]
inline auto begin_of_array_like(array_t<remove_cv<T>>&a)
noexcept{
return(T*)a.begin();}
9033 [[nodiscard]]
inline auto begin_of_array_like(
const array_t<remove_cv<T>>&a)
noexcept{
return(
const T*)a.begin();}
9038 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9039 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/deduction_guides.hpp"
9049 template <
class T,
class...U>
9050 array_t(T,U...) -> array_t<T>;
9052 array_t(array_t<T>) -> array_t<T>;
9057 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9058 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_export.hpp"
9067 #define export using array_n::
9073 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9074 #if defined(ELC_TEST_ON)
9075 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_test.hpp"
9087 ELC_TEST_EVENTNAME(
"array部分测试");
9089 array_t<int>anarray;
9090 stest_accert(anarray.size()==0);
9092 stest_accert(anarray.size()==5);
9094 stest_accert(anarray[2]==99);
9096 stest_accert(anarray[2]==99);
9098 swap(anarray,anarray);
9100 check_memory_lack();
9102 inline void test_log_out(){
9104 inline void test_end(){
9111 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/array/_body.hpp"
9116 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
9117 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9126 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/base_function_t.hpp"
9135 namespace function_n{
9138 template<
class Ret_t,
class...Args_t>
9141 typedef comn_ptr_t<this_t>ptr_t;
9144 virtual Ret_t call(Args_t...)=0;
9147 [[nodiscard]]
virtual const void*get_data_begin()
const noexcept=0;
9148 [[nodiscard]]
virtual bool equal_with(
const void*)
const=0;
9149 [[noreturn]]
virtual void throw_self_ptr()
const=0;
9150 [[noreturn]]
virtual void throw_self_ptr()=0;
9151 [[nodiscard]]
bool operator==(
const this_t&a)
const{
9152 return this->get_type_info()==a.get_type_info()&&this->equal_with(a.get_data_begin());
9154 template<
typename T>
9155 [[nodiscard]]
bool operator==(
const T&a)
const{
9156 return this->get_type_info()==type_info<T>&&this->equal_with(addressof(a));
9158 typedef Ret_t(*func_ptr_t)(Args_t...);
9159 virtual func_ptr_t get_func_ptr()
const noexcept{
return nullptr;}
9162 template<
class T,
class Func_t>
9164 template<
class T,
class Ret_t,
class...Args_t>
9166 type_info_t<func_data_t<T,Ret_t(Args_t...)>>::template_name with_common_attribute<instance_struct>,
9167 base_func_data_t<Ret_t(Args_t...)>,function_data_warpper_t<T,Ret_t(Args_t...)>{
9168 static_assert(!::std::is_function_v<T>);
9171 typedef function_data_warpper_t<T,Ret_t(Args_t...)>data_t;
9172 typedef base_t::ptr_t ptr_t;
9173 typedef base_t::func_ptr_t func_ptr_t;
9175 [[nodiscard]]
bool is_unique()
const noexcept{
return get_ref_num((
base_t*)
this)==1;}
9177 using data_t::data_t;
9179 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override final{
return type_info<T>;}
9180 [[nodiscard]]
virtual const void*get_data_begin()
const noexcept override final{
return addressof(data_t::get_data());}
9181 [[noreturn]]
virtual void throw_self_ptr()
const override final{
throw addressof(data_t::get_data());}
9182 [[noreturn]]
virtual void throw_self_ptr()
override final{
throw addressof(data_t::get_data());}
9183 [[nodiscard]]
virtual bool equal_with(
const void*a)
const noexcept(equal.able<T>?equal.nothrow<T>:
true)
override final{
9184 if constexpr(equal.able<T>)
9185 return data_t::get_data()==*remove_const(
reinterpret_cast<const T*
>(a));
9189 [[nodiscard]]
virtual Ret_t call(Args_t...args)
noexcept(invoke<T>.nothrow<Args_t...>)
override final{
9190 return data_t::operator()(forward<Args_t>(args)...);
9194 virtual func_ptr_t get_func_ptr()
const noexcept override final{
9195 if constexpr(type_info<const T>.can_convert_to<func_ptr_t>)
9196 return static_cast<func_ptr_t
>(data_t::get_data());
9204 template<
class Ret_t,
class...Args_t>
9207 typedef base_t::ptr_t ptr_t;
9210 virtual Ret_t call(Args_t...)noexcept_as(Ret_t())
override final{
return Ret_t();}
9211 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override final{
return type_info<void>;}
9212 [[nodiscard]]
virtual const void*get_data_begin()
const noexcept override final{
return null_ptr;}
9213 [[noreturn]]
virtual void throw_self_ptr()
const override final{
throw(
const void*)null_ptr;}
9214 [[noreturn]]
virtual void throw_self_ptr()
override final{
throw(
void*)null_ptr;}
9215 [[nodiscard]]
virtual bool equal_with(
const void*)
const noexcept override final{
return true;}
9217 template<
class Ret_t,
class...Args_t>
9220 template<
class Ret_t,
class...Args_t>
9221 [[nodiscard]]
constexpr base_func_data_t<Ret_t(Args_t...)>*the_get_null_ptr(
const base_func_data_t<Ret_t(Args_t...)>*)noexcept{
9222 return&default_func_data<Ret_t,Args_t...>;
9227 template<
class Ret_t,
class...Args_t>
9232 typedef comn_ptr_t<base_t_w>ptr_t;
9235 void swap_with(
this_t&a)
noexcept{swap(_m,a._m);}
9240 [[nodiscard]]
bool operator==(
const this_t&a)
const{
9241 return *_m==*(a._m);
9243 template<
typename T>
requires(equal.able<
base_t_w,T>)
9244 [[nodiscard]]
bool operator==(T&&a)
const noexcept(equal.nothrow<
base_t_w,T>){
9247 template<
typename T>
9248 [[nodiscard]]
bool was_an()
const noexcept{
9250 _m->throw_self_ptr();
9255 catch(
const void*){}
9258 template<
typename T>
9261 _m->throw_self_ptr();
9269 suppress_msvc_warning(26440)
9270 void operator=(
const this_t&a){_m=a._m;}
9271 Ret_t call(Args_t&&...rest)
const{
return _m->call(forward<Args_t>(rest)...);}
9274 #if !defined(_MSC_VER)
9275 template<
class T,
bool promise_nothrow_at_destruct>
9277 template<
class Ret_t,
class...Args_t,
bool nothrow,
bool promise_nothrow_at_destruct>
9283 template<
class,
bool>
9289 typedef Ret_t(*func_ptr_t)(Args_t...)
noexcept(nothrow);
9291 using base_t::ptr_t;
9295 static constexpr bool base_on_this_t_or_more_stringent_restrictions=(
9296 type_info<T>.base_on<
this_t>||
9297 type_info<T>.base_on<
base_function_t<Ret_t(Args_t...)
noexcept(bool(nothrow+1)), promise_nothrow_at_destruct >>||
9298 type_info<T>.base_on<
base_function_t<Ret_t(Args_t...)
noexcept(nothrow),
bool(promise_nothrow_at_destruct+1) >>||
9299 type_info<T>.base_on<
base_function_t<Ret_t(Args_t...)
noexcept(bool(nothrow+1)),
bool(promise_nothrow_at_destruct+1) >>
9303 static constexpr bool get_data_able=invoke<T>.able<Args_t...> && not base_on_this_t_or_more_stringent_restrictions<T>;
9305 static constexpr bool get_data_nothrow=get<func_data_t<remove_cvref<T>>>.nothrow<T>;
9307 template<
class T>
requires(get_data_able<T> && get<func_data_t<remove_cvref<T>>>.able<T>)
9308 static ptr_t get_data_from(T&&a)
noexcept(get_data_nothrow<T>){
9310 if constexpr(promise_nothrow_at_destruct and not destruct.nothrow<T>)
9311 template_error(
"unexpected assign.");
9312 if constexpr(nothrow)
9313 if constexpr(!invoke<T>.nothrow<Args_t...>)
9314 template_warning(
"the call of T was not noexcept,this may cause terminate.");
9316 return get<func_data_t<remove_cvref<T>>>(a);
9320 void swap_with(
this_t&a)
noexcept{
9321 base_t::swap_with(a);
9325 template<
class T>
requires base_on_this_t_or_more_stringent_restrictions<T>
9333 template<
class T>
requires(get_data_able<T>)
9335 _m=get_data_from(forward<T>(a));
9338 _m=get<func_data_t<func_ptr_t>>(a);
9342 this_t&operator=(
const this_t&a)&
noexcept(promise_nothrow_at_destruct)=
default;
9343 this_t&operator=(
this_t&&a)&
noexcept(promise_nothrow_at_destruct)=
default;
9344 this_t&operator=(null_ptr_t)&
noexcept(promise_nothrow_at_destruct){_m=null_ptr;
return *
this;}
9345 this_t&operator=(nullptr_t)&
noexcept(promise_nothrow_at_destruct){
return *
this=null_ptr;}
9346 template<
class T>
requires base_on_this_t_or_more_stringent_restrictions<T>
9347 this_t&operator=(
const T&a)&
noexcept(promise_nothrow_at_destruct){
9348 base_t::operator=(a);
9351 template<
class T>
requires(get_data_able<T>)
9352 this_t&
operator=(T&&a)
noexcept(get_data_nothrow<T> && promise_nothrow_at_destruct){
9353 _m=get_data_from(forward<T>(a));
9359 [[nodiscard]]
explicit operator bool()
const noexcept{
9363 Ret_t operator()(Args_t...args)
const noexcept(nothrow){
9364 suppress_msvc_warning(26447)
9365 return base_t::call(forward<Args_t>(args)...);
9371 static inline ::std::atomic<
decltype(_func_ptr_data_local)> _func_ptr_data_gobal=
nullptr;
9372 static Ret_t _func_ptr_value(Args_t...args)
noexcept{
9373 if(!_func_ptr_data_local)
9374 _func_ptr_data_local=_func_ptr_data_gobal.load(::std::memory_order_relaxed);
9375 return _func_ptr_data_local->call(forward<Args_t>(args)...);
9381 [[nodiscard]]
explicit operator func_ptr_t()
const noexcept(promise_nothrow_at_destruct){
9382 func_ptr_t a=(func_ptr_t)_m->get_func_ptr();
9384 _func_ptr_data_local=base_t::_m.get();
9385 _func_ptr_data_gobal.store(_func_ptr_data_local,::std::memory_order_relaxed);
9386 return _func_ptr_value;
9391 template<
class T,
bool promise_nothrow_at_destruct>
9393 template<
class Ret_t,
class...Args_t,
bool promise_nothrow_at_destruct>
9397 typedef base_function_t<Ret_t(Args_t...),promise_nothrow_at_destruct>this_t;
9399 template<
class,
bool>
9405 typedef Ret_t(*func_ptr_t)(Args_t...);
9407 using base_t::ptr_t;
9411 static constexpr bool base_on_this_t_or_more_stringent_restrictions=(
9412 type_info<T>.base_on<this_t>||
9413 type_info<T>.base_on<
base_function_t<Ret_t(Args_t...)noexcept, promise_nothrow_at_destruct >>||
9414 type_info<T>.base_on<
base_function_t<Ret_t(Args_t...),
bool(promise_nothrow_at_destruct+1) >>||
9415 type_info<T>.base_on<
base_function_t<Ret_t(Args_t...)noexcept,
bool(promise_nothrow_at_destruct+1) >>
9419 static constexpr
bool get_data_able=invoke<T>.able<Args_t...> && not base_on_this_t_or_more_stringent_restrictions<T>;
9421 static constexpr
bool get_data_nothrow=get<
func_data_t<remove_cvref<T>>>.nothrow<T>;
9423 template<class T> requires(get_data_able<T> && get<
func_data_t<remove_cvref<T>>>.able<T>)
9424 static auto get_data_from(T&&a)noexcept(get_data_nothrow<T>){
9426 if constexpr(promise_nothrow_at_destruct and not destruct.nothrow<T>)
9427 template_error(
"unexpected assign.");
9429 return get<func_data_t<remove_cvref<T>>>(a);
9431 explicit base_function_t(base_t::ptr_t a)
noexcept{_m=a;}
9433 void swap_with(this_t&a)
noexcept{
9434 base_t::swap_with(a);
9437 base_function_t()noexcept=default;
9438 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9439 base_function_t(const T&a)noexcept:base_t(a){}
9440 base_function_t(
const this_t&a)
noexcept:base_t(a){}
9441 base_function_t(this_t&&a)
noexcept:base_function_t(){
9444 base_function_t(null_ptr_t)
noexcept:base_function_t(){}
9445 base_function_t(nullptr_t)
noexcept:base_function_t(null_ptr){}
9446 template<
class T>
requires(get_data_able<T>)
9447 base_function_t(T&&a)
noexcept(get_data_nothrow<T>){
9448 _m=get_data_from(forward<T>(a));
9450 base_function_t(func_ptr_t a)
noexcept{
9451 _m=get<func_data_t<func_ptr_t>>(a);
9453 ~base_function_t()noexcept(promise_nothrow_at_destruct)=default;
9455 this_t&operator=(const this_t&a)noexcept(promise_nothrow_at_destruct)=default;
9456 this_t&operator=(this_t&&a)noexcept(promise_nothrow_at_destruct)=default;
9457 this_t&operator=(null_ptr_t)noexcept(promise_nothrow_at_destruct){_m=null_ptr;
return *
this;}
9458 this_t&operator=(nullptr_t)
noexcept(promise_nothrow_at_destruct){
return *
this=null_ptr;}
9459 template<
class T>
requires base_on_this_t_or_more_stringent_restrictions<T>
9460 this_t&operator=(
const T&a)&
noexcept(promise_nothrow_at_destruct){
9461 base_t::operator=(a);
9464 template<
class T>
requires(get_data_able<T>)
9465 this_t&
operator=(T&&a)
noexcept(get_data_nothrow<T> && promise_nothrow_at_destruct){
9466 _m=get_data_from(forward<T>(a));
9470 this_t deep_copy(){
return this_t{copy_get(_m.get())};}
9472 [[nodiscard]]
explicit operator bool()const noexcept{
9476 Ret_t operator()(Args_t...args){
9477 return base_t::call(forward<Args_t>(args)...);
9479 Ret_t operator()(Args_t...args)
const{
9480 return base_t::call(forward<Args_t>(args)...);
9485 static thread_local inline base_t::base_t_w* _func_ptr_data_local=
nullptr;
9486 static inline ::std::atomic<
decltype(_func_ptr_data_local)> _func_ptr_data_gobal=
nullptr;
9487 static Ret_t _func_ptr_value(Args_t...args)noexcept{
9488 if(!_func_ptr_data_local)
9489 _func_ptr_data_local=_func_ptr_data_gobal.load(::std::memory_order_relaxed);
9490 return _func_ptr_data_local->call(forward<Args_t>(args)...);
9496 [[nodiscard]]
explicit operator func_ptr_t()const noexcept(promise_nothrow_at_destruct){
9497 func_ptr_t a=(func_ptr_t)_m->get_func_ptr();
9499 _func_ptr_data_local=base_t::_m.get();
9500 _func_ptr_data_gobal.store(_func_ptr_data_local,::std::memory_order_relaxed);
9501 return _func_ptr_value;
9504 template<
class Ret_t,
class...Args_t,
bool promise_nothrow_at_destruct>
9505 struct base_function_t<Ret_t(Args_t...)noexcept,promise_nothrow_at_destruct>:function_data_saver_t<Ret_t(Args_t...)>{
9507 typedef function_data_saver_t<Ret_t(Args_t...)>base_t;
9508 typedef base_function_t<Ret_t(Args_t...)noexcept,promise_nothrow_at_destruct>this_t;
9510 template<class,
bool>
9511 friend class base_function_t;
9514 using func_data_t=function_n::func_data_t<U,Ret_t(Args_t...)>;
9516 typedef Ret_t(*func_ptr_t)(Args_t...)noexcept;
9518 using base_t::ptr_t;
9522 static constexpr
bool base_on_this_t_or_more_stringent_restrictions=(
9523 type_info<T>.base_on<this_t>||
9524 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept, promise_nothrow_at_destruct >>||
9525 type_info<T>.base_on<base_function_t<Ret_t(Args_t...)noexcept,
bool(promise_nothrow_at_destruct+1) >>
9529 static constexpr
bool get_data_able=invoke<T>.able<Args_t...> && not base_on_this_t_or_more_stringent_restrictions<T>;
9531 static constexpr
bool get_data_nothrow=get<func_data_t<remove_cvref<T>>>.nothrow<T>;
9533 template<class T> requires(get_data_able<T> && get<func_data_t<remove_cvref<T>>>.able<T>)
9534 static auto get_data_from(T&&a)noexcept(get_data_nothrow<T>){
9536 if constexpr(promise_nothrow_at_destruct and not destruct.nothrow<T>)
9537 template_error(
"unexpected assign.");
9539 if constexpr(!invoke<T>.nothrow<Args_t...>)
9540 template_warning(
"the call of T was not noexcept,this may cause terminate.");
9542 return get<func_data_t<remove_cvref<T>>>(a);
9544 explicit base_function_t(base_t::ptr_t a)
noexcept{_m=a;}
9546 void swap_with(this_t&a)
noexcept{
9547 base_t::swap_with(a);
9550 base_function_t()noexcept=default;
9551 template<class T> requires base_on_this_t_or_more_stringent_restrictions<T>
9552 base_function_t(const T&a)noexcept:base_t(a){}
9553 base_function_t(
const this_t&a)
noexcept:base_t(a){}
9554 base_function_t(this_t&&a)
noexcept:base_function_t(){
9557 base_function_t(null_ptr_t)
noexcept:base_function_t(){}
9558 base_function_t(nullptr_t)
noexcept:base_function_t(null_ptr){}
9559 template<
class T>
requires(get_data_able<T>)
9560 base_function_t(T&&a)
noexcept(get_data_nothrow<T>){
9561 _m=get_data_from(forward<T>(a));
9563 base_function_t(func_ptr_t a)
noexcept{
9564 _m=get<func_data_t<func_ptr_t>>(a);
9566 ~base_function_t()noexcept(promise_nothrow_at_destruct)=default;
9568 this_t&operator=(const this_t&a)&noexcept(promise_nothrow_at_destruct)=default;
9569 this_t&operator=(this_t&&a)&noexcept(promise_nothrow_at_destruct)=default;
9570 this_t&operator=(null_ptr_t)&noexcept(promise_nothrow_at_destruct){_m=null_ptr;
return *
this;}
9571 this_t&operator=(nullptr_t)&
noexcept(promise_nothrow_at_destruct){
return *
this=null_ptr;}
9572 template<
class T>
requires base_on_this_t_or_more_stringent_restrictions<T>
9573 this_t&operator=(
const T&a)&
noexcept(promise_nothrow_at_destruct){
9574 base_t::operator=(a);
9577 template<
class T>
requires(get_data_able<T>)
9578 this_t&
operator=(T&&a)
noexcept(get_data_nothrow<T> && promise_nothrow_at_destruct){
9579 _m=get_data_from(forward<T>(a));
9583 this_t deep_copy(){
return this_t{copy_get(_m.get())};}
9585 [[nodiscard]]
explicit operator bool()const noexcept{
9589 Ret_t operator()(Args_t...args)noexcept{
9590 suppress_msvc_warning(26447)
9591 return base_t::call(forward<Args_t>(args)...);
9593 Ret_t operator()(Args_t...args)const noexcept{
9594 suppress_msvc_warning(26447)
9595 return base_t::call(forward<Args_t>(args)...);
9600 static thread_local inline base_t::base_t_w* _func_ptr_data_local=
nullptr;
9601 static inline ::std::atomic<decltype(_func_ptr_data_local)> _func_ptr_data_gobal=
nullptr;
9602 static Ret_t _func_ptr_value(Args_t...args)noexcept{
9603 if(!_func_ptr_data_local)
9604 _func_ptr_data_local=_func_ptr_data_gobal.load(::std::memory_order_relaxed);
9605 return _func_ptr_data_local->call(forward<Args_t>(args)...);
9611 [[nodiscard]]
explicit operator func_ptr_t()const noexcept(promise_nothrow_at_destruct){
9612 func_ptr_t a=(func_ptr_t)_m->get_func_ptr();
9614 _func_ptr_data_local=base_t::_m.get();
9615 _func_ptr_data_gobal.store(_func_ptr_data_local,::std::memory_order_relaxed);
9616 return _func_ptr_value;
9620 template<
class T,
bool promise_nothrow_at_destruct>
9621 void swap(base_function_t<T,promise_nothrow_at_destruct>&a,base_function_t<T,promise_nothrow_at_destruct>&b)
noexcept{
9628 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9629 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/defs.hpp"
9638 namespace function_n{
9640 using function_t=base_function_t<T,true>;
9644 using may_throw_in_destruct_function_t=base_function_t<T,false>;
9649 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9650 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/deduction_guides.hpp"
9659 namespace function_n{
9660 template<
typename T,
typename Func_t=get_function_type<T>,
bool promise_nothrow_at_destruct>
9661 base_function_t(T)->base_function_t<Func_t,promise_nothrow_at_destruct>;
9666 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9667 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_export.hpp"
9676 #define export using function_n::
9683 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9684 #if defined(ELC_TEST_ON)
9685 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_test.hpp"
9694 namespace function_n{
9697 ELC_TEST_EVENTNAME(
"function部分测试");
9700 #if !defined(_MSC_VER)
9703 function_t<void()noexcept>
9705 a(lambda_with_catch (&tester)()
noexcept{ tester=1; });
9706 static_assert(type_info<
decltype(a)> == type_info<function_t<
void()noexcept>>);
9707 stest_accert(tester==0);
9709 stest_accert(tester==1);
9710 #if !defined(_MSC_VER)
9716 static_assert(type_info<
decltype(b)> == type_info<function_t<
void()>>);
9721 stest_accert(tester==0);
9723 stest_accert(tester==1);
9729 check_memory_lack();
9731 inline void test_log_out(){
9733 inline void test_end(){
9740 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/function/_body.hpp"
9745 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
9747 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
9757 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/base_stack.hpp"
9766 template<
typename T>
9774 constexpr_as(construct<T>(declvalue(
const T&)))
data_t(
const T&a,
data_t*b)
noexcept(construct<T>.nothrow<
const T&>):_data(a),_next(b){}
9775 constexpr_as(construct<T>(declvalue(
const T&)))
data_t(
const data_t&a)
noexcept(construct<T>.nothrow<
const T&>):_data(a._data),_next(null_ptr){}
9792 constexpr base_stack_t()noexcept:_m(null_ptr),_size(0){}
9793 void swap_with(this_t&a)
noexcept{
9795 swap(_size,a._size);
9797 this_t&operator=(this_t&&a)&
noexcept{
9801 base_stack_t(this_t&&a)
noexcept:base_stack_t(){
9804 this_t&operator=(
const this_t&a)&noexcept_as(declvalue(this_t).copy()){
9805 return operator=(a.copy());
9807 base_stack_t(
const this_t&a)noexcept_as(declvalue(this_t).copy()):base_stack_t(a.copy()){}
9808 ~base_stack_t()noexcept(unget.nothrow<data_t>){
9809 suppress_msvc_warning(26494)
9811 while(_m!=null_ptr){
9817 void clear()noexcept(re_construct.nothrow<this_t>){
9820 [[nodiscard]]
bool empty()const noexcept{
9821 return _m==null_ptr;
9823 template<
typename U>
9824 [[nodiscard]]maybe_fail_reference<T>find(U&&a)noexcept_as(declvalue(T&)==a){
9826 while(tmp!=null_ptr){
9833 [[nodiscard]]
bool in_stack(
const T&a)
const noexcept_as(declvalue(this_t).find(a).not_fail()){
9834 return remove_const(
this)->find(a).not_fail();
9836 [[nodiscard]]
bool not_in_stack(
const T&a)
const noexcept_as(declvalue(this_t).in_stack(a)){
9837 return not in_stack(a);
9839 [[nodiscard]]
size_t size()const noexcept{
9843 static constexpr bool add_nothrow=
noexcept(get<data_t>(declvalue(
const T&),declvalue(data_t*)));
9844 void add(
const T&a)
noexcept(add_nothrow){
9845 _m=get<data_t>(a,_m);
9849 static constexpr bool remove_nothrow=unget.nothrow<data_t>;
9850 template<
typename T_>
9851 bool remove(
const T_&a)
noexcept(remove_nothrow && equal.nothrow<T_,T>){
9852 data_t*tmp=_m,**tmp_=&_m;
9853 while(tmp!=null_ptr){
9865 #define expr declvalue(func_t)(declvalue(T&))
9866 template<
typename func_t>
requires was_not_an_ill_form(expr)
9867 void for_each(func_t&&func)noexcept_as(expr){
9869 while(tmp!=null_ptr){
9876 #define expr declvalue(func_t)(declvalue(const T&))
9877 template<
typename func_t>
requires was_not_an_ill_form(expr)
9878 void for_each(func_t&&func)
const noexcept_as(expr){
9879 const data_t*tmp=_m;
9880 while(tmp!=null_ptr){
9887 void add(data_t*a)
noexcept{
9893 [[nodiscard]]hash_t get_top_hash()noexcept_as(hash(declvalue(T&))){
9895 return hash(_m->_data);
9899 void move_top_to(this_t&a)
noexcept{
9909 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
9910 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/auto_stack.hpp"
9919 template<
typename T>
9928 using base_t::base_t;
9932 this_t&operator=(
this_t&&a)&
noexcept{base_t::operator=(move(a));
return*
this;}
9933 template<
typename U>
9935 data_t*tmp=_m,**tmp_=&_m;
9936 while(tmp!=null_ptr){
9948 [[nodiscard]]
bool in_stack(
const T&a)
const noexcept_as(declvalue(
this_t).find(a).not_fail()){
9949 return remove_const(
this)->find(a).not_fail();
9951 [[nodiscard]]
bool not_in_stack(
const T&a)
const noexcept_as(declvalue(
this_t).in_stack(a)){
9952 return not in_stack(a);
9958 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
9960 #if defined(ELC_TEST_ON)
9961 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_test.hpp"
9971 ELC_TEST_EVENTNAME(
"stack部分测试");
9974 stest_accert(a.size()==0);
9978 stest_accert(a.size()==3);
9980 stest_accert(a.size()==2);
9982 a.for_each(lambda_with_catch(&add_num)(
int a){add_num+=a;});
9983 stest_accert(add_num==4);
9984 auto_stack_t<int>b=a;
9985 stest_accert(b.not_in_stack(2));
9987 stest_accert(a.in_stack(3));
9991 stest_accert(b.size()==0);
9993 check_memory_lack();
9995 inline void test_log_out(){
9997 inline void test_end(){
10002 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
10005 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_export.hpp"
10014 #define export using stack_n::
10015 export auto_stack_t;
10016 export base_stack_t;
10021 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/stacks/_body.hpp"
10025 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10026 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10035 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/defs.hpp"
10044 namespace hash_table_n{
10045 template<
typename T,
template<
typename>
class stack_t=auto_stack_t,
size_t bucket_max_size=256>
10048 typedef stack_t<T>bucket_t;
10050 typedef array_t<bucket_t>base_t_w;
10054 void swap(base_t_w&a)
noexcept{_m.swap_with(a);}
10056 [[nodiscard]]bucket_t&find_bucket(
hash_t a)
noexcept{
10057 return _m[a%_m.size()];
10059 void bucket_count_grow()
noexcept{
10060 this_t tmp(special_init,get_next_gold_size_to_resize_for_hash(_m.size()));
10061 for(bucket_t&a:_m){
10063 a.move_top_to(tmp.find_bucket(a.get_top_hash()));
10068 this_t copy()
noexcept(copy_construct.nothrow<base_t_w>){
10074 ~hash_table_t()
noexcept(destruct.nothrow<base_t_w>)=
default;
10076 operator base_t_w&()
noexcept{
return _m;}
10077 operator const base_t_w&()
const noexcept{
return _m;}
10082 this_t&operator=(base_t_w&&a)&
noexcept{
10086 this_t&operator=(
const base_t_w&a)&
noexcept{
10091 template<
typename U>
10092 static constexpr bool hash_nothrow=
noexcept(hash(declvalue(U)));
10093 template<
typename U>
10094 static constexpr bool find_nothrow=hash_nothrow<U>&&
noexcept(declvalue(bucket_t).find(declvalue(U)));
10096 void add(
const T&a)
noexcept(hash_nothrow<const T&>&&bucket_t::add_nothrow){
10097 auto&bucket=find_bucket(hash(a));
10099 if(bucket.size() > bucket_max_size)
10100 bucket_count_grow();
10102 bool remove(
const T&a)
noexcept(bucket_t::remove_nothrow){
10103 auto&bucket=find_bucket(hash(a));
10104 bool remove_success=bucket.remove(a);
10105 if constexpr(is_unstable_hash<T>)
10106 if(not remove_success){
10108 if(is_eq(i,bucket))
10110 remove_success=i.remove(a);
10115 return remove_success;
10117 template<
typename U>
10119 auto&bucket=find_bucket(hash(a));
10120 suppress_msvc_warning(26496)
10121 auto reference=bucket.find(a);
10122 if constexpr(is_unstable_hash<T>)
10123 if(reference.fail()){
10125 if(is_eq(i,bucket))
10127 re_construct[&reference](i.find(a));
10128 if(reference.not_fail())
10134 [[nodiscard]]
bool in_table(
const T&a)noexcept_as(declvalue(
this_t).find(a).not_fail()){
10135 return find(a).not_fail();
10137 [[nodiscard]]
bool not_in_table(
const T&a)noexcept_as(declvalue(
this_t).in_table(a)){
10138 return not in_table(a);
10141 size_t size()
noexcept{
10143 for(
const bucket_t&a:_m){
10149 void clear()
noexcept(re_construct.nothrow<
this_t>){
10150 re_construct(
this);
10153 #define expr declvalue(func_t)(declvalue(T&))
10154 template<
typename func_t>
requires was_not_an_ill_form(expr)
10155 void for_each(func_t&&func)noexcept_as(expr){
10156 for(bucket_t&a:_m){
10162 #define expr declvalue(func_t)(declvalue(const T&))
10163 template<
typename func_t>
requires was_not_an_ill_form(expr)
10164 void for_each(func_t&&func)
const noexcept_as(expr){
10165 for(bucket_t&a:_m){
10171 #define expr declvalue(func_t)(declvalue(bucket_t&))
10172 template<
typename func_t>
requires was_not_an_ill_form(expr)
10173 void for_each_bucket(func_t&&func)noexcept_as(expr){
10178 #define expr declvalue(func_t)(declvalue(const bucket_t&))
10179 template<
typename func_t>
requires was_not_an_ill_form(expr)
10180 void for_each_bucket(func_t&&func)
const noexcept_as(expr){
10185 template<
typename T,
template<
typename>
class stack_t,
size_t _,
size_t __>
10187 template<
typename T,
template<
typename>
class stack_t,
size_t _>
10188 inline void swap(hash_table_t<T,stack_t,_>&a,
typename hash_table_t<T,stack_t,_>::base_t_w&b)
noexcept{a.swap(b);}
10189 template<
typename T,
template<
typename>
class stack_t,
size_t _>
10190 inline void swap(
typename hash_table_t<T,stack_t,_>::base_t_w&b,hash_table_t<T,stack_t,_>&a)
noexcept{a.swap(b);}
10195 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10196 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_export.hpp"
10205 #define export using hash_table_n::
10206 export hash_table_t;
10211 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10212 #if defined(ELC_TEST_ON)
10213 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_test.hpp"
10222 namespace hash_table_n{
10224 inline void test(){
10225 ELC_TEST_EVENTNAME(
"hash_table部分测试");
10229 check_memory_lack();
10231 inline void test_log_out(){
10233 inline void test_end(){
10240 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/hash_table/_body.hpp"
10245 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10247 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10256 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/defs.hpp"
10266 template<
typename T,
typename key_t,
template<
typename>
class stack_t=auto_stack_t,
size_t bucket_max_size=256>
10274 data_t(
const data_t&) =
default;
10275 data_t(
const key_t&a,
const T&b)
noexcept(copy_construct.nothrow<key_t> && copy_construct.nothrow<T>):_key(a),_value(b){}
10280 [[nodiscard]]
bool operator==(
const data_t&a)
const noexcept_as(a._value==*_m){
10281 return bool(a._value==*_m);
10285 [[nodiscard]]
bool operator==(
const key_t&a)noexcept_as(_key==a){
10286 return bool(_key==a);
10288 [[nodiscard]]constexpr_as(hash(_key))
operator decltype(hash(_key))()
const noexcept_as(hash(_key)){
10294 [[nodiscard]]
bool empty(){
10295 return _value==const_default_value_of<T>;
10298 typedef hash_table_t<data_t,stack_t,bucket_max_size>base_t_w;
10300 mutable base_t_w _m;
10302 map_t(
const base_t_w&a)
noexcept:_m(a){}
10303 this_t copy()noexcept(copy_construct.nothrow<base_t_w>){
10307 map_t()noexcept=default;
10308 ~map_t()noexcept(destruct.nothrow<base_t_w>)=default;
10309 map_t(const this_t&a)noexcept=default;
10310 map_t(this_t&&a)noexcept=default;
10312 this_t&operator=(this_t&&a)noexcept{
10316 this_t&operator=(
const this_t&a)
noexcept{
10317 return operator=(a.copy());
10321 void swap(map_t<T,key_t,stack_t,_>&a)
noexcept{swap(_m,a._m);}
10323 [[nodiscard]]T&operator[](
const key_t&a)noexcept_as(_m.add({a,T()})){
10324 auto tmp=_m.find(a);
10329 return tmp.get_ref()._value;
10331 [[nodiscard]]
const T&operator[](
const key_t&a)
const noexcept{
10332 auto tmp=_m.find(a);
10333 return tmp.fail()?const_default_value_of<T>:tmp.get_ref()._value;
10335 void clear()noexcept(re_construct.nothrow<this_t>){
10336 re_construct(
this);
10339 #define expr declvalue(func_t)(declvalue(T&))
10340 template<
typename func_t>
requires was_not_an_ill_form(expr)
10341 void for_each(func_t&&func)noexcept_as(expr){
10342 _m.for_each(lambda(data_t&a)noexcept_as(expr){
10348 #define expr declvalue(func_t)(declvalue(const T&))
10349 template<
typename func_t>
requires was_not_an_ill_form(expr)
10350 void for_each(func_t&&func)
const noexcept_as(expr){
10351 _m.for_each(lambda(data_t&a)noexcept_as(expr){
10352 func(add_const<T&>(a._value));
10357 static constexpr bool shrink_nothow=stack_t<data_t>::remove_nothrow;
10358 void shrink()const noexcept(shrink_nothow){
10359 _m.for_each_bucket(lambda(stack_t<data_t>&a)
noexcept(shrink_nothow && equal.nothrow<T>){
10360 while(a.remove(data_t::seek_value_t(const_default_value_of<T>)));
10364 using_method_from_value(size,_m,
const);
10366 bool operator==(
const this_t&a)
const noexcept(shrink_nothow && equal.nothrow<T>){
10369 if(size()!=a.size())
10372 _m.for_each(lambda_with_catch(&a)(data_t&b){
10373 if(a[b._key]!=b._value)
10374 throw (this_t*)(
nullptr);
10383 template<
typename T,
typename key_t,
template<
typename>
class stack_t,
size_t _,
size_t __>
10384 inline void swap(map_t<T,key_t,stack_t,_>&a,map_t<T,key_t,stack_t,__>&b)
noexcept{a.swap(b);}
10389 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10390 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_export.hpp"
10399 #define export using map_n::
10405 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10406 #if defined(ELC_TEST_ON)
10407 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_test.hpp"
10418 inline void test(){
10419 ELC_TEST_EVENTNAME(
"map部分测试");
10423 check_memory_lack();
10425 inline void test_log_out(){
10427 inline void test_end(){
10434 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/map/_body.hpp"
10439 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10441 #if defined(ELC_TEST_ON)
10442 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_test.hpp"
10451 inline void test(){
10452 ELC_TEST_EVENTNAME(
"container部分测试");
10454 function_n::test();
10457 inline void test_log_out(){
10458 array_n::test_log_out();
10459 function_n::test_log_out();
10460 stack_n::test_log_out();
10462 inline void test_end(){
10463 array_n::test_end();
10464 function_n::test_end();
10465 stack_n::test_end();
10470 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/container/_body.hpp"
10475 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
10477 using namespace container;
10479 namespace memory::gc_n{
10481 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10490 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10499 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/roots/_body.hpp"
10510 template<
typename T>
10513 template<
typename T>
10519 base_stack_t<value_t>_roots;
10521 constexpr roots_t()
noexcept=
default;
10524 using_method_from_value(map,_roots);
10525 using_method_from_value(add,_roots);
10526 using_method_from_value(remove,_roots);
10527 using_method_from_value(for_each,_roots);
10529 void map_and_mark()noexcept_as(declvalue(
value_t)->map_and_mark()){
10531 lambda(
value_t&a)noexcept_as(a->map_and_mark())
10538 template<
typename T>
10541 template<
typename T>
10546 roots_of<T>.add(
this);
10548 virtual T& get()
noexcept=0;
10549 virtual void map_and_mark()
noexcept=0;
10551 template<
typename T>
10552 inline T&
root_of<T>::get()noexcept{
return const_default_value_of<T>;}
10553 template<
typename T>
10554 inline void root_of<T>::map_and_mark()noexcept{}
10558 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10559 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/mark_able_for_gc/_body.hpp"
10568 template<
typename T>
10576 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10577 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/others/_body.hpp"
10591 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_flags/_body.hpp"
10595 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10597 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10606 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/default_method/decl.hpp"
10615 template<
class T,enable_flag>
10616 inline void gc_method_of()noexcept;
10617 template<class T,enable_flag>
10618 [[nodiscard]]inline
bool gc_success_identifier_of()noexcept;
10622 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10624 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/defs.hpp"
10635 typedef function_t<void()
noexcept>gc_method_t;
10636 typedef function_t<bool()
noexcept>success_identifier_t;
10638 base_stack_t<gc_method_t>_gc_methods;
10639 base_stack_t<success_identifier_t>_gc_success_identifiers;
10640 mutable flag _gc_running=
flag(not_set);
10642 inline void operator()()
const noexcept{
10644 die_with(locale::str::gc_fail);
10646 if(_gc_methods.empty())
10647 die_with(locale::str::empty_gc_method);
10648 _gc_methods.for_each(invoke<const gc_method_t>._as(nothing));
10649 _gc_running.unset();
10651 [[nodiscard]]
inline bool success()
const noexcept{
10652 bool success=_gc_success_identifiers.empty();
10653 _gc_success_identifiers.for_each(
10654 lambda_with_catch(&success)(
const success_identifier_t&a)
noexcept{
10662 inline void add_gc_method(gc_method_t a)
noexcept{
10663 _gc_methods.add(a);
10665 inline void remove_gc_method(gc_method_t a){
10666 _gc_methods.remove(a);
10669 inline void add_gc_success_identifier(success_identifier_t a)
noexcept{
10670 _gc_success_identifiers.add(a);
10672 inline void remove_gc_success_identifier(success_identifier_t a){
10673 _gc_success_identifiers.remove(a);
10678 add_gc_method((
void(*)()
noexcept)gc_method_of<T>);
10679 add_gc_success_identifier(gc_success_identifier_of<T>);
10683 remove_gc_method(gc_method_of<T>);
10684 remove_gc_success_identifier(gc_success_identifier_of<T>);
10690 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10692 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/default_method/defs.hpp"
10701 namespace default_gc_for_type{
10702 template<
class T,enable_if(type_info<T>.has_attribute(count_able))>
10703 distinctive
inline size_t count_for_success_identify;
10706 constexpr bool use_default_gc_able =
10721 enable_adl(destory_by_gc);
10723 void destory_by_gc(T*){
10724 template_error(
"this function should not be instantiated,please overload the function destory_by_gc in the namespace where this type is defined.");
10727 template<
class T>
requires use_default_gc_able<T>
10728 inline void default_gc_method()noexcept{
10729 constexpr auto&info=type_info<T>;
10731 if constexpr(info.has_attribute(
count_able))
10732 count_for_success_identify<T> = the_number_of(info);
10735 if constexpr(info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root))
10736 roots_of<T>.map_and_mark();
10737 if constexpr(info.has_attribute(can_shrink) || (info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root)))
10739 lambda(T*a)
noexcept{
10740 if constexpr(info.has_attribute(can_shrink))
10742 if constexpr(info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root)){
10743 auto& b=attribute_cast<mark_able_for_gc>(*a);
10755 constexpr bool use_default_gc_success_identifier_able = type_info<T>.has_attribute(count_able);
10757 template<
class T>
requires use_default_gc_success_identifier_able<T>
10758 [[nodiscard]]
inline bool default_gc_success_identifier()noexcept{
10759 constexpr auto&info=type_info<T>;
10760 if constexpr(info.has_attribute(count_able)){
10761 return count_for_success_identify<T> _big_than_ the_number_of(info);
10765 template<
class T,enable_if(default_gc_for_type::use_default_gc_able<T>)>
10766 inline void gc_method_of()noexcept{
10767 default_gc_for_type::default_gc_method<T>();
10769 template<
class T,enable_if(default_gc_for_type::use_default_gc_success_
identifier_able<T>)>
10770 [[nodiscard]]
inline bool gc_success_identifier_of()noexcept{
10771 return default_gc_for_type::default_gc_success_identifier<T>();
10776 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_t/_body.hpp"
10780 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10782 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/defs.hpp"
10791 distinctive
inline gc_t gc;
10795 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10798 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/gc_for_alloc/_body.hpp"
10807 inline void gc_for_alloc()noexcept{
10813 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10814 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10824 INTER_NAMESPACE(memory::ptr_n)
10826 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/defs.hpp"
10835 enable_adl(map_and_mark_for_gc);
10836 template<
typename T>
10837 void map_and_mark_for_gc(T*)
noexcept{
10838 template_error(
"this function should not be instantiated,please overload the function map_and_mark_for_gc in the namespace where this type is defined");
10840 using ::elc::defs::memory::gc_n::root_of;
10841 template<
class T,enable_if(
10843 comn_ptr_t<T>::replace_check_nothrow &&
10844 type_info<T>.has_attribute(gc_n::have_root)
10851 template<
class assign_t>
requires was_not_an_ill_form(declvalue(
base_t)=declvalue(assign_t))
10852 this_t&operator=(assign_t&&a)noexcept_as(base_t::operator=(forward<assign_t>(a))){
10853 base_t::operator=(forward<assign_t>(a));
10856 virtual T& get()
noexcept override{
10857 return base_t::operator*();
10859 virtual void map_and_mark()
noexcept override{
10860 map_and_mark_for_gc(&**
this);
10866 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10867 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/deduction_guides.hpp"
10881 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10885 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_export.hpp"
10894 INTER_NAMESPACE(memory)
10895 #define export using memory::ptr_n::
10902 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/root_ptr/_body.hpp"
10904 INTER_NAMESPACE(memory::gc_n)
10908 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10910 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_export.hpp"
10920 INTER_NAMESPACE(memory)
10921 #define export using gc_n::
10925 export mark_able_for_gc;
10929 INTER_NAMESPACE(memory::gc_n)
10933 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
10935 #if defined(ELC_TEST_ON)
10936 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_test.hpp"
10945 #if!defined(_MSC_VER)
10946 struct gc_tester:
type_info_t<gc_tester>::template_name
10947 with_common_attribute<can_map_all,can_shrink,count_able,mark_able_for_gc,never_in_array,ref_able>,
10949 distinctive
static inline int shrink_time=0;
10950 distinctive
static inline int destroy_time=0;
10951 ~gc_tester()noexcept{destroy_time++;}
10955 static void reset_times(){
10956 shrink_time=destroy_time=0;
10959 static_assert(type_info<gc_tester>.base_on<can_map_all<gc_tester>>);
10960 void map_and_mark_for_gc(gc_tester*a){
10961 attribute_ptr_cast<mark_able_for_gc>(a)->mark();
10963 void destory_by_gc(gc_tester*a){
10967 inline void test(){
10968 #if!defined(_MSC_VER)
10969 ELC_TEST_EVENTNAME(
"gc部分测试");
10972 using ::std::srand;
10973 srand((
unsigned)time(
nullptr));
10974 gc.add_gc_method(type_info<gc_tester>);
10975 for(
int t=rand()%7;t--;)
10978 root_ptr_t<gc_tester> name=get<gc_tester>();
10979 for(i=rand()%72;i--;){
10980 #pragma warning(suppress: 4189)
10981 auto p=get<gc_tester>();
10984 stest_accert(gc_tester::shrink_time==i+1);
10985 stest_accert(gc_tester::destroy_time==i);
10986 stest_accert(get_size_of_get(&*name)==1);
10988 check_memory_lack();
10991 inline void test_log_out(){
10994 inline void test_end(){
11000 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/memory/gc/_body.hpp"
11005 #line 40 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11007 using namespace memory;
11009 #if defined(ELC_TEST_ON)
11010 namespace base_part_test{
11011 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_test.hpp"
11020 inline void test(){
11021 ELC_TEST_EVENTNAME(
"base部分测试");
11026 inline void test_log_out(){
11027 memory::test_log_out();
11028 container::test_log_out();
11030 inline void test_end(){
11031 memory::test_end();
11032 container::test_end();
11037 #line 46 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11041 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11049 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
11060 #if defined(_MSC_VER)
11061 #pragma warning(pop)
11063 #undef suppress_msvc_warning
11064 #undef disable_msvc_warning
11065 #undef push_msvc_warning
11066 #undef pop_msvc_warning
11067 #undef push_and_disable_msvc_warning
11070 #undef BIT_POSSIBILITY
11072 #if defined(ELC_VOID_NAME)
11073 #define void the_void
11078 #undef noexcept_as_auto
11079 #undef constexpr_as
11080 #undef constexpr_as_auto
11082 #undef using_method_from_base_t
11083 #undef using_method_from_value
11088 #undef re_declvalue
11093 #undef template_error
11094 #undef template_warning
11096 #undef type_info_of
11097 #undef type_name_of
11099 #undef is_common_attribute
11100 #undef is_special_attribute
11102 #undef has_attribute
11103 #undef not_has_attribute
11105 #undef float_size_of
11108 #undef def_common_attribute_with_nothing
11109 #undef def_special_attribute_with_nothing
11111 #undef common_attribute_t
11112 #undef special_attribute_t
11115 #undef enabled_by_default
11116 #undef disabled_by_default
11117 #undef enable_if_not_ill_form
11120 #undef was_an_ill_form
11121 #undef was_an_ill_form_with_parameter
11122 #undef was_not_an_ill_form
11123 #undef was_not_an_ill_form_and_noexcept
11124 #undef was_not_an_ill_form_with_parameter
11126 #undef recursive_lambda
11127 #undef get_recursive_lambda_caller
11129 #undef lambda_with_catch
11130 #undef self_recursion
11131 #undef lambda_RLSRRS
11139 #undef _small_than_
11141 #if defined(_MSC_VER)
11147 #undef INTER_NAMESPACE
11148 #undef BREAK_NAMESPACE
11153 #undef template_name
11156 #undef not_in_debug
11161 #undef ELC_TEST_EVENTNAME
11163 #undef override_instance_struct
11167 #undef force_inline
11169 #undef with_no_vtable
11171 #undef in_consteval
11173 #undef no_vtable_struct
11174 #undef no_vtable_class
11178 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11182 #line 50 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11186 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_export.hpp"
11195 #define export using defs::base::
11200 #line 53 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base/_body.hpp"
11205 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
11210 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
11211 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
11220 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
11224 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
11225 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
11234 #if !defined(ELC_BASE_EXCEPTION)
11235 #define ELC_BASE_EXCEPTION
11236 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
11249 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
11253 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
11254 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11263 #if defined(ELC_TEST)
11264 #error "this part cannot be tested."
11267 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
11277 typedef char32_t char_t;
11279 typedef int64_t int_t;
11281 typedef uint64_t uint_t;
11283 typedef double float_t;
11285 typedef long double float_size_t;
11290 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11291 namespace elc::defs{
11292 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
11300 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11312 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11314 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
11325 #define BIT_POSSIBILITY 2
11329 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11331 #if defined(_MSC_VER)
11332 #pragma warning(push,ELC_WARNING_LEVEL)
11333 #pragma warning(disable:4099)
11334 #pragma warning(disable:26812)
11335 #pragma warning(disable:4584)
11336 #pragma warning(disable:4250)
11337 #pragma warning(disable:26432)
11338 #pragma warning(disable:26435)
11339 #pragma warning(disable:26481)
11340 #pragma warning(disable:26446)
11341 #pragma warning(disable:26434)
11342 #pragma warning(disable:26429)
11343 #pragma warning(disable:26471)
11344 #pragma warning(disable:26474)
11345 #pragma warning(disable:26473)
11346 #pragma warning(disable:26456)
11347 #pragma warning(disable:26485)
11348 #pragma warning(disable:26490)
11349 #pragma warning(disable:26472)
11350 #pragma warning(disable:26482)
11351 #pragma warning(disable:26493)
11353 #if defined(_MSC_VER)
11354 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
11355 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
11356 #define push_msvc_warning() __pragma(warning(push))
11357 #define pop_msvc_warning() __pragma(warning(pop))
11358 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
11360 #define suppress_msvc_warning(...)
11361 #define disable_msvc_warning(...)
11362 #define push_msvc_warning()
11363 #define pop_msvc_warning()
11364 #define push_and_disable_msvc_warning(...)
11367 #if defined(ELC_VOID_NAME)
11372 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
11373 #define noexcept_as_auto MAGIC
11374 #define constexpr_as(...) MAGIC constexpr
11375 #define constexpr_as_auto MAGIC MAGIC constexpr
11377 #define using_method_from_base_t(name,...) \
11378 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
11379 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
11381 return base_t::name(forward<Args>(rest)...);\
11384 #define using_method_from_value(name,value_name,...) \
11385 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
11386 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
11388 return value_name.name(forward<Args>(rest)...);\
11391 #define floop while(__builtin_is_my_dick_still_there())
11392 #define enable_adl(name) void name()noexcept=delete
11394 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
11395 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
11397 #define declvalue(...) (::std::declval<__VA_ARGS__>())
11400 #define template_error(reason) static_assert(template_error_helper<T>,reason)
11402 #define template_warning(reason) template_warning_helper<T>(reason)
11405 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
11406 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
11408 #define is_common_attribute(name) public attribute<T,name<T>>
11409 #define is_special_attribute(name) public attribute<T,name>
11411 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
11412 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
11415 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
11417 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
11420 #define def_common_attribute_with_nothing(name) \
11421 template<typename T>\
11424 #define def_special_attribute_with_nothing(name) \
11427 #define common_attribute_t template<class>class
11428 #define special_attribute_t class
11438 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
11440 #define enabled_by_default class enable_state=void
11442 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
11444 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
11446 #define enable_flag class enable_state
11448 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
11449 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
11450 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
11451 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
11452 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
11455 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
11457 #define get_recursive_lambda_caller(name) \
11458 lambda_with_catch(&)(auto&&...Args){\
11459 return name(name,Args...);\
11464 #define lambda_with_catch(...) [__VA_ARGS__]
11466 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
11468 #define lambda_RLSRRS _my_jb_super_sb_name_
11476 #define elseif else if
11478 #define _big_than_ >
11480 #define _small_than_ <
11482 #if defined(_MSC_VER)
11489 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
11491 #define BREAK_NAMESPACE }
11494 #define template_name template
11496 #define type_name class
11498 #if defined(DEBUG) || defined(_DEBUG)
11499 #define not_in_debug 0
11501 #define not_in_debug 1
11505 #define ec(ch) U ## ch
11507 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
11508 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
11510 #define ELC_TEST_EVENTNAME(name)
11513 #define override_instance_struct \
11515 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
11516 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
11517 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
11518 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
11519 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
11521 #if defined(_WIN32)
11522 #define distinctive __declspec(dllexport)
11524 #define distinctive
11527 #if defined(_WIN32)
11528 #define force_inline __forceinline
11529 #elif defined(__GNUC__)
11530 #define force_inline __attribute__((always_inline)) inline
11532 #define force_inline inline
11535 #if defined(_WIN32)
11536 #define with_no_vtable __declspec(novtable)
11538 #define with_no_vtable
11541 #define in_consteval (::std::is_constant_evaluated())
11543 #define no_vtable_struct struct with_no_vtable
11544 #define no_vtable_class class with_no_vtable
11548 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
11552 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11554 namespace exception_n{
11555 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/exception/_body.hpp"
11564 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/exception/exception.hpp"
11574 const char_t* _constexpr_str=locale::str::exception::unknow_error;
11577 constexpr exception(
const constexpr_str_t<char_t>&str)
noexcept:_constexpr_str(str){}
11579 virtual constexpr const char_t*what()
noexcept{
return _constexpr_str;}
11581 inline constexpr exception::~exception()noexcept{}
11584 using exception::exception;
11589 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/exception/_body.hpp"
11593 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11595 namespace exceptions=exception_n;
11597 #if defined(ELC_TEST_ON)
11598 namespace base_exception_part_test{
11599 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_test.hpp"
11607 inline void test(){
11608 ELC_TEST_EVENTNAME(
"base_exception部分测试");
11610 inline void test_log_out(){
11612 inline void test_end(){
11617 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11621 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11629 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
11640 #if defined(_MSC_VER)
11641 #pragma warning(pop)
11643 #undef suppress_msvc_warning
11644 #undef disable_msvc_warning
11645 #undef push_msvc_warning
11646 #undef pop_msvc_warning
11647 #undef push_and_disable_msvc_warning
11650 #undef BIT_POSSIBILITY
11652 #if defined(ELC_VOID_NAME)
11653 #define void the_void
11658 #undef noexcept_as_auto
11659 #undef constexpr_as
11660 #undef constexpr_as_auto
11662 #undef using_method_from_base_t
11663 #undef using_method_from_value
11668 #undef re_declvalue
11673 #undef template_error
11674 #undef template_warning
11676 #undef type_info_of
11677 #undef type_name_of
11679 #undef is_common_attribute
11680 #undef is_special_attribute
11682 #undef has_attribute
11683 #undef not_has_attribute
11685 #undef float_size_of
11688 #undef def_common_attribute_with_nothing
11689 #undef def_special_attribute_with_nothing
11691 #undef common_attribute_t
11692 #undef special_attribute_t
11695 #undef enabled_by_default
11696 #undef disabled_by_default
11697 #undef enable_if_not_ill_form
11700 #undef was_an_ill_form
11701 #undef was_an_ill_form_with_parameter
11702 #undef was_not_an_ill_form
11703 #undef was_not_an_ill_form_and_noexcept
11704 #undef was_not_an_ill_form_with_parameter
11706 #undef recursive_lambda
11707 #undef get_recursive_lambda_caller
11709 #undef lambda_with_catch
11710 #undef self_recursion
11711 #undef lambda_RLSRRS
11719 #undef _small_than_
11721 #if defined(_MSC_VER)
11727 #undef INTER_NAMESPACE
11728 #undef BREAK_NAMESPACE
11733 #undef template_name
11736 #undef not_in_debug
11741 #undef ELC_TEST_EVENTNAME
11743 #undef override_instance_struct
11747 #undef force_inline
11749 #undef with_no_vtable
11751 #undef in_consteval
11753 #undef no_vtable_struct
11754 #undef no_vtable_class
11758 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
11762 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11765 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_export.hpp"
11774 #define export using defs::exception_n::
11776 export runtime_exception;
11781 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_exception/_body.hpp"
11786 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
11791 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
11792 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
11801 #if !defined(ELC_BASE_STREAM)
11802 #define ELC_BASE_STREAM
11803 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
11812 #if defined(ELC_TEST)
11813 #error "this part cannot be tested."
11815 namespace elc::defs{
11816 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
11824 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11836 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11838 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
11849 #define BIT_POSSIBILITY 2
11853 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
11855 #if defined(_MSC_VER)
11856 #pragma warning(push,ELC_WARNING_LEVEL)
11857 #pragma warning(disable:4099)
11858 #pragma warning(disable:26812)
11859 #pragma warning(disable:4584)
11860 #pragma warning(disable:4250)
11861 #pragma warning(disable:26432)
11862 #pragma warning(disable:26435)
11863 #pragma warning(disable:26481)
11864 #pragma warning(disable:26446)
11865 #pragma warning(disable:26434)
11866 #pragma warning(disable:26429)
11867 #pragma warning(disable:26471)
11868 #pragma warning(disable:26474)
11869 #pragma warning(disable:26473)
11870 #pragma warning(disable:26456)
11871 #pragma warning(disable:26485)
11872 #pragma warning(disable:26490)
11873 #pragma warning(disable:26472)
11874 #pragma warning(disable:26482)
11875 #pragma warning(disable:26493)
11877 #if defined(_MSC_VER)
11878 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
11879 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
11880 #define push_msvc_warning() __pragma(warning(push))
11881 #define pop_msvc_warning() __pragma(warning(pop))
11882 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
11884 #define suppress_msvc_warning(...)
11885 #define disable_msvc_warning(...)
11886 #define push_msvc_warning()
11887 #define pop_msvc_warning()
11888 #define push_and_disable_msvc_warning(...)
11891 #if defined(ELC_VOID_NAME)
11896 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
11897 #define noexcept_as_auto MAGIC
11898 #define constexpr_as(...) MAGIC constexpr
11899 #define constexpr_as_auto MAGIC MAGIC constexpr
11901 #define using_method_from_base_t(name,...) \
11902 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
11903 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
11905 return base_t::name(forward<Args>(rest)...);\
11908 #define using_method_from_value(name,value_name,...) \
11909 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
11910 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
11912 return value_name.name(forward<Args>(rest)...);\
11915 #define floop while(__builtin_is_my_dick_still_there())
11916 #define enable_adl(name) void name()noexcept=delete
11918 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
11919 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
11921 #define declvalue(...) (::std::declval<__VA_ARGS__>())
11924 #define template_error(reason) static_assert(template_error_helper<T>,reason)
11926 #define template_warning(reason) template_warning_helper<T>(reason)
11929 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
11930 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
11932 #define is_common_attribute(name) public attribute<T,name<T>>
11933 #define is_special_attribute(name) public attribute<T,name>
11935 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
11936 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
11939 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
11941 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
11944 #define def_common_attribute_with_nothing(name) \
11945 template<typename T>\
11948 #define def_special_attribute_with_nothing(name) \
11951 #define common_attribute_t template<class>class
11952 #define special_attribute_t class
11962 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
11964 #define enabled_by_default class enable_state=void
11966 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
11968 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
11970 #define enable_flag class enable_state
11972 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
11973 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
11974 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
11975 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
11976 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
11979 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
11981 #define get_recursive_lambda_caller(name) \
11982 lambda_with_catch(&)(auto&&...Args){\
11983 return name(name,Args...);\
11988 #define lambda_with_catch(...) [__VA_ARGS__]
11990 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
11992 #define lambda_RLSRRS _my_jb_super_sb_name_
12000 #define elseif else if
12002 #define _big_than_ >
12004 #define _small_than_ <
12006 #if defined(_MSC_VER)
12013 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
12015 #define BREAK_NAMESPACE }
12018 #define template_name template
12020 #define type_name class
12022 #if defined(DEBUG) || defined(_DEBUG)
12023 #define not_in_debug 0
12025 #define not_in_debug 1
12029 #define ec(ch) U ## ch
12031 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
12032 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
12034 #define ELC_TEST_EVENTNAME(name)
12037 #define override_instance_struct \
12039 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
12040 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
12041 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
12042 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
12043 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
12045 #if defined(_WIN32)
12046 #define distinctive __declspec(dllexport)
12048 #define distinctive
12051 #if defined(_WIN32)
12052 #define force_inline __forceinline
12053 #elif defined(__GNUC__)
12054 #define force_inline __attribute__((always_inline)) inline
12056 #define force_inline inline
12059 #if defined(_WIN32)
12060 #define with_no_vtable __declspec(novtable)
12062 #define with_no_vtable
12065 #define in_consteval (::std::is_constant_evaluated())
12067 #define no_vtable_struct struct with_no_vtable
12068 #define no_vtable_class class with_no_vtable
12072 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
12076 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12078 namespace stream_n{
12079 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/base_streams/_body.hpp"
12088 push_and_disable_msvc_warning(4250);
12089 enum seek_type{beg,end,cur};
12092 virtual void*seek(seek_type,int_t)=0;
12093 virtual void*tell(){
return this->seek(cur,0);}
12094 virtual void seek_to(
void*)=0;
12095 virtual void sync()=0;
12096 virtual void flush()=0;
12097 virtual void close()=0;
12101 virtual void write(
const byte*buf,
size_t size)=0;
12103 void write(
const T*v,
size_t size=1){
12104 this->write(cast_to_data(v),size*
sizeof(T));
12109 virtual size_t read(
byte*buf,
size_t size)=0;
12111 size_t read(T*v,
size_t size=1){
12112 return this->read(cast_to_data(v),size*
sizeof(T))/
sizeof(T);
12120 virtual void*seek(seek_type,int_t)
noexcept override=0;
12121 virtual void*tell()
noexcept override{
return this->seek(cur,0);}
12122 virtual void seek_to(
void*)
noexcept override=0;
12123 virtual void sync()
noexcept override=0;
12124 virtual void flush()
noexcept override=0;
12125 virtual void close()
noexcept override=0;
12128 virtual void write(
const byte*buf,
size_t size)
noexcept override=0;
12130 void write(
const T*v,
size_t size=1)
noexcept{
12131 this->write(cast_to_data(v),size*
sizeof(T));
12135 virtual size_t read(
byte*buf,
size_t size)
noexcept override=0;
12137 size_t read(T*v,
size_t size=1)
noexcept{
12138 return this->read(cast_to_data(v),size*
sizeof(T))/
sizeof(T);
12164 pop_msvc_warning();
12168 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12170 using namespace stream_n;
12172 #if defined(ELC_TEST_ON)
12173 namespace base_stream_part_test{
12174 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_test.hpp"
12182 inline void test(){
12183 ELC_TEST_EVENTNAME(
"base_stream部分测试");
12185 inline void test_log_out(){
12187 inline void test_end(){
12192 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12196 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
12204 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
12215 #if defined(_MSC_VER)
12216 #pragma warning(pop)
12218 #undef suppress_msvc_warning
12219 #undef disable_msvc_warning
12220 #undef push_msvc_warning
12221 #undef pop_msvc_warning
12222 #undef push_and_disable_msvc_warning
12225 #undef BIT_POSSIBILITY
12227 #if defined(ELC_VOID_NAME)
12228 #define void the_void
12233 #undef noexcept_as_auto
12234 #undef constexpr_as
12235 #undef constexpr_as_auto
12237 #undef using_method_from_base_t
12238 #undef using_method_from_value
12243 #undef re_declvalue
12248 #undef template_error
12249 #undef template_warning
12251 #undef type_info_of
12252 #undef type_name_of
12254 #undef is_common_attribute
12255 #undef is_special_attribute
12257 #undef has_attribute
12258 #undef not_has_attribute
12260 #undef float_size_of
12263 #undef def_common_attribute_with_nothing
12264 #undef def_special_attribute_with_nothing
12266 #undef common_attribute_t
12267 #undef special_attribute_t
12270 #undef enabled_by_default
12271 #undef disabled_by_default
12272 #undef enable_if_not_ill_form
12275 #undef was_an_ill_form
12276 #undef was_an_ill_form_with_parameter
12277 #undef was_not_an_ill_form
12278 #undef was_not_an_ill_form_and_noexcept
12279 #undef was_not_an_ill_form_with_parameter
12281 #undef recursive_lambda
12282 #undef get_recursive_lambda_caller
12284 #undef lambda_with_catch
12285 #undef self_recursion
12286 #undef lambda_RLSRRS
12294 #undef _small_than_
12296 #if defined(_MSC_VER)
12302 #undef INTER_NAMESPACE
12303 #undef BREAK_NAMESPACE
12308 #undef template_name
12311 #undef not_in_debug
12316 #undef ELC_TEST_EVENTNAME
12318 #undef override_instance_struct
12322 #undef force_inline
12324 #undef with_no_vtable
12326 #undef in_consteval
12328 #undef no_vtable_struct
12329 #undef no_vtable_class
12333 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
12337 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12340 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_export.hpp"
12349 #define export using defs::
12350 export base_stream;
12351 export base_ostream;
12352 export base_istream;
12353 export base_iostream;
12354 export noexcept_stream;
12355 export noexcept_ostream;
12356 export noexcept_istream;
12357 export noexcept_iostream;
12362 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/base_stream/_body.hpp"
12367 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
12372 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
12373 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12382 #if !defined(ELC_CORE)
12384 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
12393 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
12397 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12398 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
12407 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_exception"
12411 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12412 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
12421 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_stream"
12425 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
12426 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
12435 #if defined(ELC_TEST)
12436 #error "this part cannot be tested."
12438 namespace elc::defs{
12439 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
12447 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
12459 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
12461 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
12472 #define BIT_POSSIBILITY 2
12476 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
12478 #if defined(_MSC_VER)
12479 #pragma warning(push,ELC_WARNING_LEVEL)
12480 #pragma warning(disable:4099)
12481 #pragma warning(disable:26812)
12482 #pragma warning(disable:4584)
12483 #pragma warning(disable:4250)
12484 #pragma warning(disable:26432)
12485 #pragma warning(disable:26435)
12486 #pragma warning(disable:26481)
12487 #pragma warning(disable:26446)
12488 #pragma warning(disable:26434)
12489 #pragma warning(disable:26429)
12490 #pragma warning(disable:26471)
12491 #pragma warning(disable:26474)
12492 #pragma warning(disable:26473)
12493 #pragma warning(disable:26456)
12494 #pragma warning(disable:26485)
12495 #pragma warning(disable:26490)
12496 #pragma warning(disable:26472)
12497 #pragma warning(disable:26482)
12498 #pragma warning(disable:26493)
12500 #if defined(_MSC_VER)
12501 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
12502 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
12503 #define push_msvc_warning() __pragma(warning(push))
12504 #define pop_msvc_warning() __pragma(warning(pop))
12505 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
12507 #define suppress_msvc_warning(...)
12508 #define disable_msvc_warning(...)
12509 #define push_msvc_warning()
12510 #define pop_msvc_warning()
12511 #define push_and_disable_msvc_warning(...)
12514 #if defined(ELC_VOID_NAME)
12519 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
12520 #define noexcept_as_auto MAGIC
12521 #define constexpr_as(...) MAGIC constexpr
12522 #define constexpr_as_auto MAGIC MAGIC constexpr
12524 #define using_method_from_base_t(name,...) \
12525 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
12526 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
12528 return base_t::name(forward<Args>(rest)...);\
12531 #define using_method_from_value(name,value_name,...) \
12532 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
12533 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
12535 return value_name.name(forward<Args>(rest)...);\
12538 #define floop while(__builtin_is_my_dick_still_there())
12539 #define enable_adl(name) void name()noexcept=delete
12541 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
12542 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
12544 #define declvalue(...) (::std::declval<__VA_ARGS__>())
12547 #define template_error(reason) static_assert(template_error_helper<T>,reason)
12549 #define template_warning(reason) template_warning_helper<T>(reason)
12552 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
12553 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
12555 #define is_common_attribute(name) public attribute<T,name<T>>
12556 #define is_special_attribute(name) public attribute<T,name>
12558 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
12559 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
12562 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
12564 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
12567 #define def_common_attribute_with_nothing(name) \
12568 template<typename T>\
12571 #define def_special_attribute_with_nothing(name) \
12574 #define common_attribute_t template<class>class
12575 #define special_attribute_t class
12585 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
12587 #define enabled_by_default class enable_state=void
12589 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
12591 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
12593 #define enable_flag class enable_state
12595 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
12596 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
12597 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
12598 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
12599 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
12602 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
12604 #define get_recursive_lambda_caller(name) \
12605 lambda_with_catch(&)(auto&&...Args){\
12606 return name(name,Args...);\
12611 #define lambda_with_catch(...) [__VA_ARGS__]
12613 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
12615 #define lambda_RLSRRS _my_jb_super_sb_name_
12623 #define elseif else if
12625 #define _big_than_ >
12627 #define _small_than_ <
12629 #if defined(_MSC_VER)
12636 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
12638 #define BREAK_NAMESPACE }
12641 #define template_name template
12643 #define type_name class
12645 #if defined(DEBUG) || defined(_DEBUG)
12646 #define not_in_debug 0
12648 #define not_in_debug 1
12652 #define ec(ch) U ## ch
12654 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
12655 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
12657 #define ELC_TEST_EVENTNAME(name)
12660 #define override_instance_struct \
12662 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
12663 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
12664 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
12665 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
12666 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
12668 #if defined(_WIN32)
12669 #define distinctive __declspec(dllexport)
12671 #define distinctive
12674 #if defined(_WIN32)
12675 #define force_inline __forceinline
12676 #elif defined(__GNUC__)
12677 #define force_inline __attribute__((always_inline)) inline
12679 #define force_inline inline
12682 #if defined(_WIN32)
12683 #define with_no_vtable __declspec(novtable)
12685 #define with_no_vtable
12688 #define in_consteval (::std::is_constant_evaluated())
12690 #define no_vtable_struct struct with_no_vtable
12691 #define no_vtable_class class with_no_vtable
12695 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
12699 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
12702 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12711 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/decl.hpp"
12721 typedef comn_ptr_t<node_like>ptr;
12722 typedef weak_ptr_t<node_like>weak_ptr;
12723 typedef comn_ptr_t<const node_like>const_ptr;
12724 typedef weak_ptr_t<const node_like>const_weak_ptr;
12728 namespace string_n{
12729 template<
typename char_T>
12731 typedef string_t<char_t> string;
12733 using string_n::string_t;
12734 using string_n::string;
12735 template<constexpr_str_n::constexpr_str_t_literal_helper str_helper>
12736 inline constexpr string operator""_elc_string()noexcept;
12737 INTER_NAMESPACE(core)
12739 template<typename T>
12740 [[nodiscard]]inline ptr make_long_term_binary_node_from(T a)noexcept;
12742 template<typename T>
12743 constexpr
bool as_ptr_nothrow_helper()noexcept{
12744 if constexpr(was_not_an_ill_form(ptr(&declvalue(T))))
12745 return noexcept(ptr(&declvalue(T)));
12746 elseif
constexpr(was_not_an_ill_form(const_ptr(&declvalue(T))))
12747 return noexcept(const_ptr(&declvalue(T)));
12748 elseif
constexpr(was_not_an_ill_form(
static_cast<node_like&
>(declvalue(T))))
12749 return noexcept(&
static_cast<node_like&
>(declvalue(T)));
12750 elseif
constexpr(was_not_an_ill_form(
static_cast<const node_like&
>(declvalue(T))))
12751 return noexcept(&
static_cast<const node_like&
>(declvalue(T)));
12752 elseif
constexpr(was_not_an_ill_form(
static_cast<value&
>(declvalue(T))))
12753 return noexcept(ptr(
static_cast<value&
>(declvalue(T))));
12754 elseif
constexpr(was_not_an_ill_form(
static_cast<const value&
>(declvalue(T))))
12755 return noexcept(const_ptr(
static_cast<value&
>(declvalue(T))));
12756 elseif
constexpr(was_not_an_ill_form(ptr(declvalue(T))))
12757 return noexcept(ptr(declvalue(T)));
12758 elseif
constexpr(was_not_an_ill_form(const_ptr(declvalue(T))))
12759 return noexcept(const_ptr(declvalue(T)));
12760 elseif
constexpr(type_info<remove_cvref<T>> == type_info<char_t>)
12761 return noexcept(make_long_term_binary_node_from<char_t>(declvalue(T)));
12762 elseif
constexpr(::std::is_integral_v<remove_cvref<T>>){
12763 if constexpr(::std::is_signed_v<remove_cvref<T>>)
12764 return noexcept(make_long_term_binary_node_from<int_t>(declvalue(T)));
12766 return noexcept(make_long_term_binary_node_from<uint_t>(declvalue(T)));
12768 elseif
constexpr(::std::is_floating_point_v<remove_cvref<T>>)
12769 return noexcept(make_long_term_binary_node_from<float_t>(declvalue(T)));
12770 elseif
constexpr(construct<string>.able<T>){
12771 return noexcept(make_long_term_binary_node_from<string>(declvalue(T)));
12774 template<
typename T>
12775 decltype(
auto) as_ptr(T&&a)
noexcept(as_ptr_nothrow_helper<T>()){
12776 ELC_TEST_EVENTNAME(
"as_ptr转换");
12777 if constexpr(was_not_an_ill_form(ptr(&a)))
12779 elseif
constexpr(was_not_an_ill_form(const_ptr(&a)))
12780 return const_ptr(&a);
12781 elseif
constexpr(was_not_an_ill_form(
static_cast<node_like&
>(a)))
12782 return &
static_cast<node_like&
>(a);
12783 elseif
constexpr(was_not_an_ill_form(
static_cast<const node_like&
>(a)))
12784 return &
static_cast<const node_like&
>(a);
12785 elseif
constexpr(was_not_an_ill_form(
static_cast<value&
>(a)))
12786 return ptr(
static_cast<value&
>(a));
12787 elseif
constexpr(was_not_an_ill_form(
static_cast<const value&
>(a)))
12788 return const_ptr(
static_cast<value&
>(a));
12789 elseif
constexpr(was_not_an_ill_form(ptr(a)))
12791 elseif
constexpr(was_not_an_ill_form(const_ptr(a)))
12792 return const_ptr(a);
12793 elseif
constexpr(type_info<remove_cvref<T>> == type_info<char_t>)
12794 return make_long_term_binary_node_from<char_t>(a);
12795 elseif
constexpr(::std::is_integral_v<remove_cvref<T>>){
12796 if constexpr(::std::is_signed_v<remove_cvref<T>>)
12797 return make_long_term_binary_node_from<int_t>(a);
12799 return make_long_term_binary_node_from<uint_t>(a);
12801 elseif
constexpr(::std::is_floating_point_v<remove_cvref<T>>)
12802 return make_long_term_binary_node_from<float_t>(a);
12803 elseif
constexpr(construct<string>.able<T>){
12804 return make_long_term_binary_node_from<string>(a);
12808 template<
typename T>
12809 constexpr bool as_value_nothrow_helper()noexcept{
12810 if constexpr(was_not_an_ill_form(
static_cast<value&
>(declvalue(T))))
12811 return noexcept(
static_cast<value&
>(declvalue(T)));
12812 elseif
constexpr(was_not_an_ill_form(
static_cast<const value&
>(declvalue(T))))
12813 return noexcept(
static_cast<const value&
>(declvalue(T)));
12814 elseif
constexpr(was_not_an_ill_form(as_ptr(declvalue(T)))){
12815 if constexpr(type_info<
decltype(as_ptr(declvalue(T)))> == type_info<ptr>)
12816 return noexcept(value(as_ptr(declvalue(T))));
12817 elseif
constexpr(type_info<
decltype(as_ptr(declvalue(T)))> == type_info<const_ptr>)
12818 return noexcept((
const value)remove_const((
const node_like*)as_ptr(declvalue(T))));
12821 template<
typename T>
12822 decltype(
auto) as_value(T&& a)
noexcept(as_value_nothrow_helper<T>()){
12823 ELC_TEST_EVENTNAME(
"as_value转换");
12824 if constexpr(was_not_an_ill_form(
static_cast<value&
>(a)))
12825 return static_cast<value&
>(a);
12826 elseif
constexpr(was_not_an_ill_form(
static_cast<const value&
>(a)))
12827 return static_cast<const value&
>(a);
12828 elseif
constexpr(was_not_an_ill_form(as_ptr(declvalue(T)))){
12829 if constexpr(type_info<
decltype(as_ptr(declvalue(T)))> == type_info<ptr>)
12830 return value(as_ptr(forward<T>(a)));
12831 elseif
constexpr(type_info<
decltype(as_ptr(declvalue(T)))> == type_info<const_ptr>)
12832 return (
const value)remove_const((
const node_like*)as_ptr(forward<T>(a)));
12838 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12840 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/node_like.hpp"
12849 [[nodiscard]]
inline ptr make_list()noexcept;
12850 template<typename T,typename...Args>
12851 [[nodiscard]]inline ptr make_list(T&&first,Args&&...rest);
12854 with_common_attribute<abstract_base,weak_ref_able,
replace_able,ref_able>{
12860 [[nodiscard]]
virtual value be_eval();
12861 [[nodiscard]]
virtual value be_call(ptr);
12863 [[nodiscard]]
virtual logical_bool equal_with(const_ptr)
const noexcept=0;
12864 [[nodiscard]]
virtual logical_bool eq_with(const_ptr a)
const noexcept{
return a.get()==
this;}
12865 [[nodiscard]]
virtual constexpr size_t equal_level()
const noexcept{
return 36;}
12866 [[nodiscard]]
virtual constexpr size_t eq_level()
const noexcept{
return 36;}
12872 [[nodiscard]]
virtual value arec(
const value)=0;
12874 [[nodiscard]]
value operator[](
const value index);
12875 [[nodiscard]]
value operator[](
auto&&index){
12876 return operator[](as_value(index));
12879 virtual void clear()
noexcept=0;
12881 [[nodiscard]]
virtual explicit operator hash_t()
const noexcept{
return hash((
void*)
this);}
12882 void destroy()
noexcept{
12883 this->be_replace_as(null_ptr);
12885 virtual void be_replace_as(ptr a)
noexcept{
12890 [[nodiscard]]
virtual explicit operator logical_bool()
const noexcept{
return true;}
12891 [[nodiscard]]
explicit operator bool()
const noexcept{
return(
bool)this->
operator logical_bool();}
12893 template<
typename...Args>
12894 inline value operator()(Args&&...rest){
return this->be_call(make_list(forward<Args>(rest)...));}
12896 [[nodiscard]]
logical_bool eq(const_ptr a)
const noexcept{
12897 const auto this_eqlv = this->eq_level();
12898 const auto arg_eqlv = a->eq_level();
12899 if(this_eqlv _small_than_ arg_eqlv)
12900 return a->eq_with(
this);
12901 elseif(this_eqlv _big_than_ arg_eqlv)
12902 return this->eq_with(a);
12904 return this->eq_with(a)&&a->eq_with(
this);
12906 [[nodiscard]]
logical_bool equal(const_ptr a)
const noexcept{
12907 const auto this_equlv = this->equal_level();
12908 const auto arg_equlv = a->equal_level();
12909 if(this_equlv _small_than_ arg_equlv)
12910 return a->equal_with(
this);
12911 elseif(this_equlv _big_than_ arg_equlv)
12912 return this->equal_with(a);
12914 return this->equal_with(a)&&a->equal_with(
this);
12917 [[nodiscard]]ptr operator&()
noexcept{
return this;}
12918 [[nodiscard]]const_ptr operator&()
const noexcept{
return this;}
12920 return a.equal(
this);
12923 friend void the_waiting_for_destroy(
node_like* a)
noexcept;
12924 virtual void waiting_for_destroy()
noexcept{clear();}
12932 [[nodiscard]]
inline logical_bool the_pointer_equal(
const node_like*a,
const node_like*b)
noexcept{
12935 [[nodiscard]]
inline hash_t the_pointer_hash(
const node_like*a)
noexcept{
12936 return a->operator hash_t();
12939 inline void the_waiting_for_destroy(node_like*a)
noexcept{
12940 a->waiting_for_destroy();
12942 inline void the_destroy_and_free(node_like*a)
noexcept{
12947 inline void the_destroy(node_like*a)
noexcept{
12953 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12954 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/ptr.hpp"
12963 typedef comn_ptr_t<node_like>ptr;
12964 typedef weak_ptr_t<node_like>weak_ptr;
12965 typedef comn_ptr_t<const node_like>const_ptr;
12966 typedef weak_ptr_t<const node_like>const_weak_ptr;
12970 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
12971 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/value.hpp"
12983 with_common_attribute<abstract_base,ref_able,never_in_array,replace_able>,
13010 virtual void be_set(ptr)=0;
13011 [[nodiscard]]
virtual ptr get_value()=0;
13012 [[nodiscard]]
virtual base_data_t*copy()
const noexcept=0;
13016 distinctive
inline static struct null_data_t final:instance_struct<null_data_t>
13019 virtual ~null_data_t()
noexcept override final=
default;
13021 virtual void be_set(ptr a)
noexcept override final{}
13022 [[nodiscard]]
virtual ptr get_value()
noexcept override final{
return null_ptr;}
13023 [[nodiscard]]
virtual base_data_t*copy()
const noexcept override final{
return remove_const(
this);}
13024 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override final{
return type_info<null_data_t>;}
13034 virtual void be_set(ptr)
noexcept override final{}
13035 [[nodiscard]]
virtual ptr get_value()
noexcept override final{
return _m;}
13036 [[nodiscard]]
virtual base_data_t*copy()
const noexcept override final{
return get<constexpr_data_t>(_m);}
13037 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override final{
return type_info<constexpr_data_t>;}
13047 virtual void be_set(ptr a)
noexcept override final{_m=a;}
13048 [[nodiscard]]
virtual ptr get_value()
noexcept override final{
return _m;}
13049 [[nodiscard]]
virtual base_data_t*copy()
const noexcept override final{
return get<variable_data_t>(_m);}
13050 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override final{
return type_info<variable_data_t>;}
13053 mutable comn_ptr_t<base_data_t> _m;
13057 explicit value(ptr a)
noexcept:_m(get<constexpr_data_t>(a)){}
13058 explicit value(node_like* a)
noexcept:value(ptr(a)){}
13059 value(base_data_t*a)
noexcept:_m(a){}
13061 value(
const this_t&a)
noexcept=
default;
13062 value(this_t&&a)
noexcept=
default;
13063 ~value()noexcept=default;
13065 this_t&operator=(ptr a){
13069 this_t&operator=(
auto&&a){
13070 return operator=(as_ptr(a));
13073 [[nodiscard]]
operator ptr(){
13074 return _m->get_value();
13076 [[nodiscard]]
operator const_ptr()
const{
13077 return _m->get_value();
13079 [[nodiscard]]ptr operator&(){
13080 return operator ptr();
13082 [[nodiscard]]const_ptr operator&()
const{
13083 return operator const_ptr();
13085 [[nodiscard]]
explicit operator bool()
const{
return bool(_m->get_value());}
13087 void ref_to(this_t a)
noexcept{
13088 _m.do_replace(a._m);
13090 void un_ref()noexcept{
13093 void re_ref_to(this_t a)
noexcept{
13096 this_t& operator>>(this_t a)
noexcept{
13101 template<
typename T>
13102 [[nodiscard]]
auto operator[](T&&index){
13103 return (*
operator&())[forward<T>(index)];
13105 template<
typename...Args>
requires(invoke<node_like>.able<Args...>)
13106 inline auto operator()(Args&&... rest)
noexcept(invoke<node_like>.nothrow<Args...>){
return(*
operator&())(forward<Args>(rest)...);}
13107 [[nodiscard]]
auto operator==(
auto&&a)
const noexcept{
13109 return const_ptr(*
this) == const_ptr(as_value(a));
13115 [[nodiscard]]
auto operator!=(
auto&&a)
const{
13116 return !operator==(a);
13118 [[nodiscard]]
operator ptr::for_delete_t*(){
13119 return _m->get_value();
13123 static value::base_data_t*the_get_null_ptr(
const value::base_data_t*)
noexcept{
13124 return&value::null_data;
13129 INTER_NAMESPACE(base)
13131 distinctive
inline core::value const_default_value_of<core::value>{special_init};
13134 INTER_NAMESPACE(core)
13138 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
13140 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/node_like_using_value_func_defs.hpp"
13149 push_and_disable_msvc_warning(26440);
13150 [[nodiscard]]
inline value node_like::be_eval(){
13151 return value(
this);
13153 [[nodiscard]]
inline value node_like::be_call(ptr){
13154 return value(
this);
13156 pop_msvc_warning();
13158 [[nodiscard]]
inline value node_like::operator[](
const value index){
13159 return arec(index);
13164 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/base_def/_body.hpp"
13168 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13169 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/_body.hpp"
13178 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/base_runtime_exception.hpp"
13188 using runtime_exception::runtime_exception;
13193 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/_body.hpp"
13194 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/core_runtime_internal_helper.hpp"
13203 namespace core_runtime_internal_helper_n{
13205 using base_runtime_exception::base_runtime_exception;
13206 constexpr base_t()
noexcept:
13219 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/runtime_exception/_body.hpp"
13223 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13224 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13233 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/base_constexpr.hpp"
13243 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<base_constexpr_t>;}
13245 [[nodiscard]]
virtual constexpr size_t equal_level()
const noexcept override{
return magic_number::god;}
13246 [[nodiscard]]
virtual constexpr size_t eq_level()
const noexcept override{
return magic_number::god;}
13251 [[nodiscard]]
virtual value arec(
const value)
noexcept override{
return value(
this);}
13253 virtual void clear()
noexcept override final{nothing}
13255 virtual void be_replace_as(ptr)
noexcept override{nothing}
13260 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13261 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/void.hpp"
13275 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<void_t>;}
13277 [[nodiscard]]
virtual constexpr size_t equal_level()
const noexcept override{
return max(type_info<size_t>);}
13278 [[nodiscard]]
virtual constexpr size_t eq_level()
const noexcept override{
return max(type_info<size_t>);}
13279 [[nodiscard]]
virtual logical_bool equal_with(const_ptr a)
const noexcept override{
13287 [[nodiscard]]
virtual constexpr explicit operator hash_t()
const noexcept override{
return hash(nothing);}
13288 [[nodiscard]]
virtual constexpr explicit operator logical_bool()
const noexcept override{
return neither;}
13291 [[nodiscard]]
constexpr node_like*the_get_null_ptr(
const node_like*)
noexcept{
return addressof((node_like&)the_void);}
13295 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13296 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/nil.hpp"
13306 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<nil_t>;}
13310 [[nodiscard]]
virtual constexpr explicit operator hash_t()
const noexcept override{
return hash(
false);}
13311 [[nodiscard]]
virtual constexpr explicit operator logical_bool()
const noexcept override{
return false;}
13316 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13317 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/t.hpp"
13327 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<t_t>;}
13331 [[nodiscard]]
virtual constexpr explicit operator hash_t()
const noexcept override{
return hash(
true);}
13332 [[nodiscard]]
virtual constexpr explicit operator logical_bool()
const noexcept override{
return true;}
13335 [[noreturn]]
virtual void be_replace_as(ptr)
noexcept override{::std::exit(0);}
13340 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/special_values/_body.hpp"
13344 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13345 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13354 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/common_node.hpp"
13366 map_t<value,const_weak_ptr> _m;
13368 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<this_t>;}
13370 [[nodiscard]]
virtual logical_bool equal_with(const_ptr a)
const noexcept override{
13371 if(a->get_type_info() != this->get_type_info())
13373 const this_t*p=down_cast<const this_t*>(a.get());
13377 [[nodiscard]]
virtual value arec(
const value index)
override{
return _m[&index];}
13379 virtual void clear()
noexcept override{_m.clear();}
13384 #line 9 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13385 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/cons.hpp"
13394 inline value car_of(ptr p){
13397 inline value cdr_of(ptr p){
13400 inline value car_of(
auto&&node){
13401 return car_of(as_ptr(node));
13403 inline value cdr_of(
auto&&node){
13404 return cdr_of(as_ptr(node));
13413 cons(ptr car,ptr cdr){
13418 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<cons>;}
13420 [[nodiscard]]
virtual logical_bool equal_with(const_ptr a)
const noexcept override{
13421 if(a->get_type_info() != this->get_type_info())
13423 const this_t*p=down_cast<const this_t*>(a.get());
13424 return _car==p->_car&&_cdr==p->_cdr;
13427 [[nodiscard]]
virtual value arec(
const value index)
override{
13434 ptr to=get<common_node>();
13435 _car >> car_of(to);
13436 _cdr >> cdr_of(to);
13442 virtual void clear()
noexcept override{as_value(&the_void)>>_car>>_cdr;}
13445 [[nodiscard]]
inline ptr make_list()noexcept{
return &nil;}
13446 template<
typename T,
typename...Args>
13447 [[nodiscard]]
inline ptr make_list(T&&first,Args&&...rest){
13448 ELC_TEST_EVENTNAME(
"make_list调用");
13449 return get<cons>(as_ptr(first),make_list(forward<Args>(rest)...));
13454 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13455 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/expr.hpp"
13466 override_instance_struct;
13472 [[nodiscard]]
virtual value be_eval()
override{
13473 return as_ptr(_car)->be_call(_cdr);
13475 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<expr>;}
13480 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13481 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/base_binary_function_node.hpp"
13493 function_t<
value(ptr)> _func;
13497 _func = lambda_with_catch(func)(ptr p)
mutable{
13499 return as_value(the_void);
13503 _func = lambda_with_catch(func)(ptr)
mutable{
13505 return as_value(the_void);
13509 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<this_t>;}
13510 [[nodiscard]]
virtual value be_call(ptr arg_list)
override{
return _func(arg_list);}
13512 [[nodiscard]]
virtual logical_bool equal_with(const_ptr a)
const noexcept override{
13513 if(a->get_type_info() != this->get_type_info())
13515 const this_t*p=down_cast<const this_t*>(a.get());
13517 return _func==p->_func;
13524 [[nodiscard]]
virtual value arec(
const value index)
override{
return the_void[index];}
13526 virtual void clear()
noexcept override{_func=
nullptr;}
13531 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13532 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/binary_node_t.hpp"
13544 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override final{
return type_info<this_t>;}
13545 [[nodiscard]]
virtual base_type_info_t get_additional_type_info()
const noexcept=0;
13547 [[noreturn]]
virtual void throw_self_ptr()
const=0;
13548 [[noreturn]]
virtual void throw_self_ptr()=0;
13549 template<
typename T>
13551 template<
typename T>
13553 template<
typename T>
13554 friend[[nodiscard]]
inline const T& const_use_by_ref_as(const_ptr p)
noexcept;
13556 template<
typename T>
13566 [[nodiscard]]
virtual base_type_info_t get_additional_type_info()
const noexcept override{
return type_info<this_t>;}
13568 static constexpr bool hash_nothrow_helper=hash.able<T>?
13571 [[nodiscard]]
virtual explicit operator hash_t()
const noexcept(hash_nothrow_helper)
override{
13572 if constexpr(hash.able<T>)
13575 #if defined(_MSC_VER)
13576 [[gsl::suppress(f.6)]]
13578 return node_like::operator
hash_t();
13581 [[noreturn]]
virtual void throw_self_ptr()
const override{
throw&_m;}
13582 [[noreturn]]
virtual void throw_self_ptr()
override{
throw&_m;}
13583 [[nodiscard]]
virtual logical_bool eq_with(const_ptr a)
const noexcept override{
13585 if constexpr(equal.able<T>){
13586 if(a->get_type_info() != this->get_type_info())
13588 const base_t*base_p=down_cast<const base_t*>(a.get());
13589 if(base_p->get_type_info() != this->get_type_info())
13591 const this_t*p=down_cast<const this_t*>(base_p);
13595 return node_like::eq_with(a);
13597 [[nodiscard]]
virtual logical_bool equal_with(const_ptr a)
const noexcept override{
13601 static constexpr bool arec_nothrow_helper=was_not_an_ill_form(arec_as_value(_m,declvalue(
const value&)))?
13602 was_not_an_ill_form_and_noexcept(arec_as_value(_m,declvalue(
const value&))):1;
13604 [[nodiscard]]
virtual value arec(
const value index)
noexcept(arec_nothrow_helper)
override{
13605 if constexpr(was_not_an_ill_form(arec_as_value(_m,index)))
13606 return arec_as_value(_m,index);
13608 return as_value(
this);
13611 static constexpr bool clear_nothrow_helper= was_not_an_ill_form(declvalue(T).clear())?
13612 was_not_an_ill_form_and_noexcept(declvalue(T).clear()):
13613 re_construct.nothrow<T>;
13615 virtual void clear()
noexcept(clear_nothrow_helper)
override{
13616 if constexpr(was_not_an_ill_form(declvalue(T).clear()))
13623 template<
typename T>
13624 [[nodiscard]]
inline bool was_an(const_ptr p)
noexcept{
13626 if(p->get_type_info() == type_info<binary_node_base_t>){
13627 auto base_p = down_cast<const binary_node_base_t*>(p.get());
13628 if(base_p->get_additional_type_info() == type_info<target_node_t>)
13630 elseif
constexpr(::std::is_class_v<T> && !::std::is_final_v<T>){
13632 base_p->throw_self_ptr();
13637 catch(
const void*){}
13642 template<
typename T>
13643 [[nodiscard]]
inline maybe_fail_reference<T> maybe_fail_use_by_ref_as(ptr p)
noexcept{
13644 typedef binary_node_t<T> target_node_t;
13645 if(p->get_type_info() == type_info<binary_node_base_t>){
13646 auto base_p = down_cast<binary_node_base_t*>(p.get());
13647 if(base_p->get_additional_type_info() == type_info<target_node_t>)
13648 return down_cast<target_node_t*>(base_p)->_m;
13649 elseif
constexpr(::std::is_class_v<T> && !::std::is_final_v<T>){
13651 base_p->throw_self_ptr();
13661 template<
typename T>
13662 [[nodiscard]]
inline T& use_by_ref_as(ptr p)
noexcept{
13663 return maybe_fail_use_by_ref_as<T>(p).get_ref();
13665 template<
typename T>
13666 [[nodiscard]]
inline const T& const_use_by_ref_as(const_ptr p)
noexcept{
13667 typedef binary_node_t<T> target_node_t;
13668 if(p->get_type_info() == type_info<binary_node_base_t>){
13669 auto base_p = down_cast<const binary_node_base_t*>(p.get());
13670 if(base_p->get_additional_type_info() == type_info<target_node_t>)
13671 return down_cast<const target_node_t*>(base_p)->_m;
13672 elseif
constexpr(::std::is_class_v<T> && !::std::is_final_v<T>){
13674 base_p->throw_self_ptr();
13676 catch(
const T*aret){
13679 catch(
const void*){}
13682 return const_default_value_of<T>;
13684 template<
typename T>
13685 [[nodiscard]]
inline T use_as(const_ptr p)
noexcept{
13686 return const_use_by_ref_as<T>(p);
13688 template<
typename T>
13689 [[nodiscard]]
inline const T& use_by_ref_as(const_ptr p)
noexcept{
13690 return const_use_by_ref_as<T>(p);
13692 template<
typename T>
13693 [[nodiscard]]
inline const T& use_by_ref_as(
auto&&a)
noexcept{
13694 return use_by_ref_as<T>(as_ptr(a));
13696 template<
typename T>
13697 [[nodiscard]]
inline ptr make_binary_node_from(T a)
noexcept{
13698 return get<binary_node_t<T>>(move(a));
13700 template<
typename T>
13701 distinctive
inline map_t<ptr,T> long_term_binary_node_storager{};
13702 template<
typename T>
13703 [[nodiscard]]
inline ptr make_long_term_binary_node_from(T a)
noexcept{
13704 ptr& to = long_term_binary_node_storager<T>[a];
13705 if(!
bool(to) || const_use_by_ref_as<T>(to)!=a)
13706 to = make_binary_node_from<T>(move(a));
13712 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13713 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/code_list.hpp"
13722 inline value eval(ptr p){
13723 return p->be_eval();
13725 inline value eval(
auto&&node){
13726 return eval(as_ptr(node));
13730 override_instance_struct;
13734 [[nodiscard]]
virtual value be_eval()
override{
13736 value aret{special_init};
13740 eval(car_of(self)) >> aret;
13752 [[nodiscard]]
virtual base_type_info_t get_type_info()
const noexcept override{
return type_info<code_list>;}
13757 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/nodes/_body.hpp"
13761 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13764 #if defined(ELC_TEST_ON)
13765 namespace core_part_test{
13766 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_test.hpp"
13774 inline void test(){
13775 ELC_TEST_EVENTNAME(
"core部分测试");
13777 inline void test_log_out(){
13779 inline void test_end(){
13784 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13788 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
13796 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
13807 #if defined(_MSC_VER)
13808 #pragma warning(pop)
13810 #undef suppress_msvc_warning
13811 #undef disable_msvc_warning
13812 #undef push_msvc_warning
13813 #undef pop_msvc_warning
13814 #undef push_and_disable_msvc_warning
13817 #undef BIT_POSSIBILITY
13819 #if defined(ELC_VOID_NAME)
13820 #define void the_void
13825 #undef noexcept_as_auto
13826 #undef constexpr_as
13827 #undef constexpr_as_auto
13829 #undef using_method_from_base_t
13830 #undef using_method_from_value
13835 #undef re_declvalue
13840 #undef template_error
13841 #undef template_warning
13843 #undef type_info_of
13844 #undef type_name_of
13846 #undef is_common_attribute
13847 #undef is_special_attribute
13849 #undef has_attribute
13850 #undef not_has_attribute
13852 #undef float_size_of
13855 #undef def_common_attribute_with_nothing
13856 #undef def_special_attribute_with_nothing
13858 #undef common_attribute_t
13859 #undef special_attribute_t
13862 #undef enabled_by_default
13863 #undef disabled_by_default
13864 #undef enable_if_not_ill_form
13867 #undef was_an_ill_form
13868 #undef was_an_ill_form_with_parameter
13869 #undef was_not_an_ill_form
13870 #undef was_not_an_ill_form_and_noexcept
13871 #undef was_not_an_ill_form_with_parameter
13873 #undef recursive_lambda
13874 #undef get_recursive_lambda_caller
13876 #undef lambda_with_catch
13877 #undef self_recursion
13878 #undef lambda_RLSRRS
13886 #undef _small_than_
13888 #if defined(_MSC_VER)
13894 #undef INTER_NAMESPACE
13895 #undef BREAK_NAMESPACE
13900 #undef template_name
13903 #undef not_in_debug
13908 #undef ELC_TEST_EVENTNAME
13910 #undef override_instance_struct
13914 #undef force_inline
13916 #undef with_no_vtable
13918 #undef in_consteval
13920 #undef no_vtable_struct
13921 #undef no_vtable_class
13925 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
13929 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13932 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_export.hpp"
13941 #define export using defs::core::
13946 export const_weak_ptr;
13955 export common_node;
13960 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
13962 #if defined(ELC_STRING)
13963 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
13973 namespace elc::defs{
13974 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
13982 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
13994 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
13996 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
14007 #define BIT_POSSIBILITY 2
14011 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14013 #if defined(_MSC_VER)
14014 #pragma warning(push,ELC_WARNING_LEVEL)
14015 #pragma warning(disable:4099)
14016 #pragma warning(disable:26812)
14017 #pragma warning(disable:4584)
14018 #pragma warning(disable:4250)
14019 #pragma warning(disable:26432)
14020 #pragma warning(disable:26435)
14021 #pragma warning(disable:26481)
14022 #pragma warning(disable:26446)
14023 #pragma warning(disable:26434)
14024 #pragma warning(disable:26429)
14025 #pragma warning(disable:26471)
14026 #pragma warning(disable:26474)
14027 #pragma warning(disable:26473)
14028 #pragma warning(disable:26456)
14029 #pragma warning(disable:26485)
14030 #pragma warning(disable:26490)
14031 #pragma warning(disable:26472)
14032 #pragma warning(disable:26482)
14033 #pragma warning(disable:26493)
14035 #if defined(_MSC_VER)
14036 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
14037 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
14038 #define push_msvc_warning() __pragma(warning(push))
14039 #define pop_msvc_warning() __pragma(warning(pop))
14040 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
14042 #define suppress_msvc_warning(...)
14043 #define disable_msvc_warning(...)
14044 #define push_msvc_warning()
14045 #define pop_msvc_warning()
14046 #define push_and_disable_msvc_warning(...)
14049 #if defined(ELC_VOID_NAME)
14054 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
14055 #define noexcept_as_auto MAGIC
14056 #define constexpr_as(...) MAGIC constexpr
14057 #define constexpr_as_auto MAGIC MAGIC constexpr
14059 #define using_method_from_base_t(name,...) \
14060 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
14061 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
14063 return base_t::name(forward<Args>(rest)...);\
14066 #define using_method_from_value(name,value_name,...) \
14067 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
14068 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
14070 return value_name.name(forward<Args>(rest)...);\
14073 #define floop while(__builtin_is_my_dick_still_there())
14074 #define enable_adl(name) void name()noexcept=delete
14076 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
14077 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
14079 #define declvalue(...) (::std::declval<__VA_ARGS__>())
14082 #define template_error(reason) static_assert(template_error_helper<T>,reason)
14084 #define template_warning(reason) template_warning_helper<T>(reason)
14087 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
14088 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
14090 #define is_common_attribute(name) public attribute<T,name<T>>
14091 #define is_special_attribute(name) public attribute<T,name>
14093 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
14094 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
14097 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
14099 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
14102 #define def_common_attribute_with_nothing(name) \
14103 template<typename T>\
14106 #define def_special_attribute_with_nothing(name) \
14109 #define common_attribute_t template<class>class
14110 #define special_attribute_t class
14120 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
14122 #define enabled_by_default class enable_state=void
14124 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
14126 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
14128 #define enable_flag class enable_state
14130 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
14131 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
14132 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
14133 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
14134 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
14137 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
14139 #define get_recursive_lambda_caller(name) \
14140 lambda_with_catch(&)(auto&&...Args){\
14141 return name(name,Args...);\
14146 #define lambda_with_catch(...) [__VA_ARGS__]
14148 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
14150 #define lambda_RLSRRS _my_jb_super_sb_name_
14158 #define elseif else if
14160 #define _big_than_ >
14162 #define _small_than_ <
14164 #if defined(_MSC_VER)
14171 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
14173 #define BREAK_NAMESPACE }
14176 #define template_name template
14178 #define type_name class
14180 #if defined(DEBUG) || defined(_DEBUG)
14181 #define not_in_debug 0
14183 #define not_in_debug 1
14187 #define ec(ch) U ## ch
14189 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
14190 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
14192 #define ELC_TEST_EVENTNAME(name)
14195 #define override_instance_struct \
14197 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
14198 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
14199 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
14200 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
14201 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
14203 #if defined(_WIN32)
14204 #define distinctive __declspec(dllexport)
14206 #define distinctive
14209 #if defined(_WIN32)
14210 #define force_inline __forceinline
14211 #elif defined(__GNUC__)
14212 #define force_inline __attribute__((always_inline)) inline
14214 #define force_inline inline
14217 #if defined(_WIN32)
14218 #define with_no_vtable __declspec(novtable)
14220 #define with_no_vtable
14223 #define in_consteval (::std::is_constant_evaluated())
14225 #define no_vtable_struct struct with_no_vtable
14226 #define no_vtable_class class with_no_vtable
14230 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
14234 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
14236 namespace string_n{
14237 template<
class char_T>
14238 value arec_as_value(string_t<char_T>&str,
const value index){
14239 size_t i=size_t(use_as<int_t>(index));
14241 i=size_t(use_as<uint_t>(index));
14242 struct arec_data_t final:instance_struct<arec_data_t>
14243 ,value::base_data_t{
14244 typename string_t<char_T>::arec_t _m;
14245 arec_data_t(string_t<char_T>&str,
size_t index)
noexcept:_m(&str,index){};
14246 arec_data_t(
const arec_data_t&ref)
noexcept:_m(special_init,ref._m){}
14247 virtual ~arec_data_t()noexcept override final=default;
14249 virtual
void be_set(ptr a)noexcept override final{move(_m)=use_as<char_T>(a);}
14250 [[nodiscard]]
virtual ptr get_value()noexcept override final{
return core::make_binary_node_from<char_T>(move(_m));}
14251 [[nodiscard]]
virtual base_data_t*copy()const noexcept override final{
return get<arec_data_t>(*
this);}
14252 [[nodiscard]]
virtual base_type_info_t get_type_info()const noexcept override final{
return type_info<arec_data_t>;}
14254 return get<arec_data_t>(str,i);
14258 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
14266 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
14277 #if defined(_MSC_VER)
14278 #pragma warning(pop)
14280 #undef suppress_msvc_warning
14281 #undef disable_msvc_warning
14282 #undef push_msvc_warning
14283 #undef pop_msvc_warning
14284 #undef push_and_disable_msvc_warning
14287 #undef BIT_POSSIBILITY
14289 #if defined(ELC_VOID_NAME)
14290 #define void the_void
14295 #undef noexcept_as_auto
14296 #undef constexpr_as
14297 #undef constexpr_as_auto
14299 #undef using_method_from_base_t
14300 #undef using_method_from_value
14305 #undef re_declvalue
14310 #undef template_error
14311 #undef template_warning
14313 #undef type_info_of
14314 #undef type_name_of
14316 #undef is_common_attribute
14317 #undef is_special_attribute
14319 #undef has_attribute
14320 #undef not_has_attribute
14322 #undef float_size_of
14325 #undef def_common_attribute_with_nothing
14326 #undef def_special_attribute_with_nothing
14328 #undef common_attribute_t
14329 #undef special_attribute_t
14332 #undef enabled_by_default
14333 #undef disabled_by_default
14334 #undef enable_if_not_ill_form
14337 #undef was_an_ill_form
14338 #undef was_an_ill_form_with_parameter
14339 #undef was_not_an_ill_form
14340 #undef was_not_an_ill_form_and_noexcept
14341 #undef was_not_an_ill_form_with_parameter
14343 #undef recursive_lambda
14344 #undef get_recursive_lambda_caller
14346 #undef lambda_with_catch
14347 #undef self_recursion
14348 #undef lambda_RLSRRS
14356 #undef _small_than_
14358 #if defined(_MSC_VER)
14364 #undef INTER_NAMESPACE
14365 #undef BREAK_NAMESPACE
14370 #undef template_name
14373 #undef not_in_debug
14378 #undef ELC_TEST_EVENTNAME
14380 #undef override_instance_struct
14384 #undef force_inline
14386 #undef with_no_vtable
14388 #undef in_consteval
14390 #undef no_vtable_struct
14391 #undef no_vtable_class
14395 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
14399 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
14404 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/core/_body.hpp"
14409 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
14414 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
14415 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
14424 #if !defined(ELC_LIB_LOADER)
14425 #define ELC_LIB_LOADER
14426 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
14435 #if !defined(ELC_STRING)
14437 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
14446 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
14450 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
14451 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
14460 #if defined(ELC_TEST)
14461 #error "this part cannot be tested."
14463 namespace elc::defs{
14464 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
14472 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14484 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14486 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
14497 #define BIT_POSSIBILITY 2
14501 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
14503 #if defined(_MSC_VER)
14504 #pragma warning(push,ELC_WARNING_LEVEL)
14505 #pragma warning(disable:4099)
14506 #pragma warning(disable:26812)
14507 #pragma warning(disable:4584)
14508 #pragma warning(disable:4250)
14509 #pragma warning(disable:26432)
14510 #pragma warning(disable:26435)
14511 #pragma warning(disable:26481)
14512 #pragma warning(disable:26446)
14513 #pragma warning(disable:26434)
14514 #pragma warning(disable:26429)
14515 #pragma warning(disable:26471)
14516 #pragma warning(disable:26474)
14517 #pragma warning(disable:26473)
14518 #pragma warning(disable:26456)
14519 #pragma warning(disable:26485)
14520 #pragma warning(disable:26490)
14521 #pragma warning(disable:26472)
14522 #pragma warning(disable:26482)
14523 #pragma warning(disable:26493)
14525 #if defined(_MSC_VER)
14526 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
14527 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
14528 #define push_msvc_warning() __pragma(warning(push))
14529 #define pop_msvc_warning() __pragma(warning(pop))
14530 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
14532 #define suppress_msvc_warning(...)
14533 #define disable_msvc_warning(...)
14534 #define push_msvc_warning()
14535 #define pop_msvc_warning()
14536 #define push_and_disable_msvc_warning(...)
14539 #if defined(ELC_VOID_NAME)
14544 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
14545 #define noexcept_as_auto MAGIC
14546 #define constexpr_as(...) MAGIC constexpr
14547 #define constexpr_as_auto MAGIC MAGIC constexpr
14549 #define using_method_from_base_t(name,...) \
14550 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
14551 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
14553 return base_t::name(forward<Args>(rest)...);\
14556 #define using_method_from_value(name,value_name,...) \
14557 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
14558 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
14560 return value_name.name(forward<Args>(rest)...);\
14563 #define floop while(__builtin_is_my_dick_still_there())
14564 #define enable_adl(name) void name()noexcept=delete
14566 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
14567 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
14569 #define declvalue(...) (::std::declval<__VA_ARGS__>())
14572 #define template_error(reason) static_assert(template_error_helper<T>,reason)
14574 #define template_warning(reason) template_warning_helper<T>(reason)
14577 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
14578 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
14580 #define is_common_attribute(name) public attribute<T,name<T>>
14581 #define is_special_attribute(name) public attribute<T,name>
14583 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
14584 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
14587 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
14589 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
14592 #define def_common_attribute_with_nothing(name) \
14593 template<typename T>\
14596 #define def_special_attribute_with_nothing(name) \
14599 #define common_attribute_t template<class>class
14600 #define special_attribute_t class
14610 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
14612 #define enabled_by_default class enable_state=void
14614 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
14616 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
14618 #define enable_flag class enable_state
14620 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
14621 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
14622 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
14623 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
14624 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
14627 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
14629 #define get_recursive_lambda_caller(name) \
14630 lambda_with_catch(&)(auto&&...Args){\
14631 return name(name,Args...);\
14636 #define lambda_with_catch(...) [__VA_ARGS__]
14638 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
14640 #define lambda_RLSRRS _my_jb_super_sb_name_
14648 #define elseif else if
14650 #define _big_than_ >
14652 #define _small_than_ <
14654 #if defined(_MSC_VER)
14661 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
14663 #define BREAK_NAMESPACE }
14666 #define template_name template
14668 #define type_name class
14670 #if defined(DEBUG) || defined(_DEBUG)
14671 #define not_in_debug 0
14673 #define not_in_debug 1
14677 #define ec(ch) U ## ch
14679 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
14680 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
14682 #define ELC_TEST_EVENTNAME(name)
14685 #define override_instance_struct \
14687 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
14688 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
14689 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
14690 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
14691 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
14693 #if defined(_WIN32)
14694 #define distinctive __declspec(dllexport)
14696 #define distinctive
14699 #if defined(_WIN32)
14700 #define force_inline __forceinline
14701 #elif defined(__GNUC__)
14702 #define force_inline __attribute__((always_inline)) inline
14704 #define force_inline inline
14707 #if defined(_WIN32)
14708 #define with_no_vtable __declspec(novtable)
14710 #define with_no_vtable
14713 #define in_consteval (::std::is_constant_evaluated())
14715 #define no_vtable_struct struct with_no_vtable
14716 #define no_vtable_class class with_no_vtable
14720 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
14724 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
14726 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/defs.hpp"
14735 namespace string_n{
14736 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
14745 inline namespace string_data_n{
14746 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_decl.hpp"
14755 template<
typename char_T>
14756 struct base_string_data_t;
14758 template<
typename char_T>
14759 struct null_string_data_t;
14760 template<
typename char_T>
14761 struct constexpr_string_data_t;
14763 template<
typename char_T>
14764 struct comn_string_data_t;
14766 template<
typename char_T>
14767 struct substr_string_data_t;
14769 template<
typename char_T>
14770 struct head_apply_string_data_t;
14771 template<
typename char_T>
14772 struct end_apply_string_data_t;
14774 template<
typename char_T>
14775 struct sum_string_data_t;
14777 template<
typename char_T>
14778 struct erased_string_data_t;
14779 template<
typename char_T>
14780 struct inserted_string_data_t;
14785 template<
typename char_T>
14786 struct same_value_compress_string_data_t;
14790 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
14792 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/base_string_data_t.hpp"
14801 template<
typename char_T>
14803 with_common_attribute<abstract_base,never_in_array,replace_able,ref_able>,
build_by_get_only{
14805 typedef comn_ptr_t<this_t> ptr_t;
14808 static_assert(
noexcept(declvalue(ptr_t).operator*()));
14810 static constexpr bool copy_assign_nothrow=copy_assign.nothrow<char_T>;
14811 static constexpr bool copy_construct_nothrow=copy_construct.nothrow<char_T>;
14812 static constexpr bool move_construct_nothrow=move_construct.nothrow<char_T>;
14813 static constexpr bool construct_nothrow=construct<char_T>.nothrow<>;
14814 static constexpr bool destruct_nothrow=destruct.nothrow<char_T>;
14815 static constexpr bool clear_nothrow=destruct_nothrow;
14816 static constexpr bool ptr_reset_nothrow=destruct_nothrow;
14817 static constexpr bool hash_nothrow=hash.nothrow<char_T>;
14818 static constexpr bool get_data_nothrow=copy_construct_nothrow&&destruct_nothrow;
14819 static constexpr bool apply_data_nothrow=construct_nothrow&©_assign_nothrow;
14836 [[nodiscard]]
bool is_unique()
noexcept{
return get_ref_num(
this)==1; }
14837 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)=0;
14841 [[nodiscard]]
virtual char_T* get_c_str(ptr_t&)
noexcept(get_data_nothrow);
14842 [[nodiscard]]
virtual const char_T* get_const_c_str(ptr_t&p)
noexcept(get_data_nothrow){
return get_c_str(p);}
14843 [[nodiscard]]
virtual const char_T* get_data(ptr_t&p)
noexcept(get_data_nothrow){
return get_c_str(p);}
14844 [[nodiscard]]
virtual char_T* get_unique_c_str(ptr_t&)
noexcept(get_data_nothrow);
14845 [[nodiscard]]
virtual size_t get_size()
noexcept=0;
14846 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept;
14847 [[nodiscard]]
virtual ptr_t apply_str_to_begin(
string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow);
14848 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow);
14849 [[nodiscard]]
virtual ptr_t apply_str_to_end(
string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow);
14850 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow);
14852 [[nodiscard]]
virtual ptr_t do_insert(
size_t pos,
string_view_t str)
noexcept(copy_construct_nothrow);
14853 [[nodiscard]]
virtual ptr_t do_insert(
size_t pos,ptr_t str)
noexcept;
14854 [[nodiscard]]
virtual ptr_t do_erase(
size_t pos,
size_t size)
noexcept;
14856 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow){
14857 const auto pos = this->get_size()-size;
14858 const auto before = get_substr_data(0,pos);
14859 const auto after = get_substr_data(pos,size);
14863 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow){
14864 const auto pos = size;
14865 const auto before = get_substr_data(0,pos);
14866 const auto after = get_substr_data(pos,this->get_size()-size);
14885 typedef compare_t::type<char_T> compare_type;
14887 bool same_type(ptr_t a)
noexcept{
return typeid(*this)==
typeid(*a);}
14888 [[nodiscard]]
virtual bool same_struct(ptr_t)
noexcept=0;
14889 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)=0;
14890 [[nodiscard]]
virtual compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)=0;
14892 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept=0;
14894 [[nodiscard]]
bool equal_with(ptr_t with)
noexcept(equal.nothrow<char_T>){
14899 if(this->has_hash_cache()&&with->has_hash_cache())
14900 if(this->get_hash_cache()!=with->get_hash_cache())
14905 suppress_msvc_warning(26494)
14909 if(same_type(with)&&same_struct(with))
14910 aret=same_struct_equal(with);
14913 aret=default_equal_method(with);
14917 equivalent_optimization(
this,with);
14922 [[nodiscard]]
bool default_equal_method(ptr_t with)
noexcept(equal.nothrow<char_T>){
14923 const size_t self_size=get_size();
14924 return equal_with(with,0,self_size);
14927 [[nodiscard]]
bool equal_with(ptr_t with,
size_t pos,
size_t size)
noexcept(equal.nothrow<char_T>){
14932 auto a=this->get_the_largest_complete_data_block_begin_form(index);
14933 auto b=with->get_the_largest_complete_data_block_begin_form(index);
14935 const size_t step=min({a.size(),b.size(),size});
14936 if(a.begin()!=b.begin())
14937 if(!equal(a.begin(),b.begin(),step))
14942 a=this->get_the_largest_complete_data_block_begin_form(index);
14944 a={a.begin()+step,note::size(a.size()-step)};
14946 b=with->get_the_largest_complete_data_block_begin_form(index);
14948 b={b.begin()+step,note::size(b.size()-step)};
14949 if(!a.size()&&!b.size())
14950 return a.size()==b.size();
14954 [[nodiscard]]
bool equal_with(
string_view_t with)
noexcept(equal.nothrow<char_T>){
14955 size_t size=with.size();
14957 auto a=this->get_the_largest_complete_data_block_begin_form(index);
14958 if(a.begin()==with.begin() && a.size()==with.size())
14961 auto b=with.begin()+index;
14962 const size_t step=min({a.size(),with.size()-index,size});
14963 if(!equal(a.begin(),b,step))
14968 a=this->get_the_largest_complete_data_block_begin_form(index);
14970 a={a.begin()+step,note::size(a.size()-step)};
14971 if(!a.size()||!size)
14972 return a.size()==size;
14975 [[nodiscard]]
bool equal_with(
const char_T*with)
noexcept(equal.nothrow<char_T>){
14976 size_t size=get_size();
14978 auto a=this->get_the_largest_complete_data_block_begin_form(index);
14979 if(a.begin()==with && with[a.size()]==char_T{})
14985 size_t step=min({a.size(),size});
14986 if(!equal(a.begin(),step,just_an_part,b,end_by_zero))
14991 a=this->get_the_largest_complete_data_block_begin_form(index);
14993 a={a.begin()+step,note::size(a.size()-step)};
15001 [[nodiscard]]compare_type compare_with(ptr_t with)
noexcept(compare.nothrow<char_T>){
15004 return strong_ordering::equivalent;
15008 suppress_msvc_warning(26494)
15012 if(same_type(with)&&same_struct(with))
15013 aret=same_struct_compare(with);
15016 aret=default_compare_method(with);
15020 equivalent_optimization(
this,with);
15025 [[nodiscard]]compare_type default_compare_method(ptr_t with)
noexcept(compare.nothrow<char_T>){
15026 const size_t self_size=get_size();
15027 return compare_with(with,0,self_size);
15030 [[nodiscard]]compare_type compare_with(ptr_t with,
size_t pos,
size_t size)
noexcept(compare.nothrow<char_T>){
15033 return strong_ordering::equivalent;
15035 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15036 auto b=with->get_the_largest_complete_data_block_begin_form(index);
15038 const size_t step=min({a.size(),b.size(),size});
15039 if(a.begin()!=b.begin())
15040 if(
auto tmp=compare(a.begin(),b.begin(),step); tmp!=0)
15045 a=this->get_the_largest_complete_data_block_begin_form(index);
15047 a={a.begin()+step,note::size(a.size()-step)};
15049 b=with->get_the_largest_complete_data_block_begin_form(index);
15051 b={b.begin()+step,note::size(b.size()-step)};
15052 if(!a.size()||!b.size())
15053 return a.size()<=>b.size();
15055 return strong_ordering::equivalent;
15057 [[nodiscard]]compare_type compare_with(
string_view_t with)
noexcept(compare.nothrow<char_T>){
15058 size_t size=with.size();
15060 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15061 if(a.begin()==with.begin() && a.size()==with.size())
15062 return strong_ordering::equivalent;
15064 auto b=with.begin()+index;
15065 size_t step=min({a.size(),with.size()-index,size});
15066 if(
auto tmp=compare(a.begin(),b,step); tmp!=0)
15071 a=this->get_the_largest_complete_data_block_begin_form(index);
15073 a={a.begin()+step,note::size(a.size()-step)};
15074 if(!a.size()||!size)
15075 return a.size()<=>size;
15078 [[nodiscard]]compare_type compare_with(
const char_T*with)
noexcept(compare.nothrow<char_T>){
15079 size_t size=get_size();
15081 auto a=this->get_the_largest_complete_data_block_begin_form(index);
15082 if(a.begin()==with && with[a.size()]==char_T{})
15083 return strong_ordering::equivalent;
15087 return strong_ordering::greater;
15088 size_t step=min({a.size(),size});
15089 if(
auto tmp=compare(a.begin(),step,just_an_part,b,end_by_zero); tmp!=0)
15094 a=this->get_the_largest_complete_data_block_begin_form(index);
15096 a={a.begin()+step,note::size(a.size()-step)};
15098 return *(with+index)==char_T{}? strong_ordering::equivalent:
15099 strong_ordering::less;
15101 return strong_ordering::greater;
15105 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)=0;
15107 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)=0;
15108 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)=0;
15111 bool _has_hash_cache=
false;
15112 bool has_hash_cache()
noexcept{
return _has_hash_cache;}
15113 void reset_hash_cache()
noexcept{_has_hash_cache=
false;}
15114 hash_t get_hash_cache()
noexcept{
return _hash_cache;}
15115 hash_t set_hash_cache(
hash_t value)
noexcept{_has_hash_cache=
true;
return _hash_cache=value;}
15117 hash_t get_hash(ptr_t&p)
noexcept(hash_nothrow){
15118 if(has_hash_cache())
15119 return get_hash_cache();
15121 const auto tmp=this->get_hash_detail(p);
15122 return p->set_hash_cache(tmp);
15126 virtual hash_t get_hash_detail(ptr_t&p)
noexcept(hash_nothrow){
15127 const auto size=get_size();
15128 const auto data=get_data(p);
15129 return hash(data,size);
15132 hash_t get_others_hash_with_calculated_before(
hash_t before,
size_t before_size,ptr_t&p,
size_t pos,
size_t size)
noexcept(hash_nothrow){
15133 if(pos==0&&size==get_size())
15134 return hash.merge_array_hash_results(before,before_size,get_hash(p),size);
15135 return this->get_others_hash_with_calculated_before_detail(before,before_size,p,pos,size);
15138 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&p,
size_t pos,
size_t size)
noexcept(hash_nothrow){
15139 return hash.with_calculated_before(before,before_size,get_data(p)+pos,size);
15142 void self_changed()
noexcept{
15143 reset_hash_cache();
15145 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept=0;
15147 [[nodiscard]]float_size_t get_memory_cost()
noexcept{
15148 return get_base_memory_cost()/get_ref_num(
this);
15150 [[nodiscard]]float_size_t get_memory_cost_after_gc()
noexcept;
15151 [[nodiscard]]float_size_t get_gc_profit()
noexcept{
return get_memory_cost()-get_memory_cost_after_gc();}
15152 [[nodiscard]]
bool positive_gc_profit()
noexcept{
return get_gc_profit() > 0;}
15167 static inline void be_replace(this_t* a,ptr_t b)
noexcept(ptr_reset_nothrow){
15168 a->be_replace_as(b);
15170 static inline void be_replace(ptr_t& a,ptr_t b)
noexcept(ptr_reset_nothrow){
15173 static inline void equivalent_optimization(
auto&& a,
auto&& b)
noexcept(ptr_reset_nothrow){
15174 if(a->get_memory_cost() >= b->get_memory_cost())
15180 template<
typename char_T>
15187 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15189 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/null_string_data_t.hpp"
15198 template<
typename char_T>
15202 using base_t::ptr_t;
15203 using base_t::string_view_t;
15205 using base_t::copy_assign_nothrow;
15206 using base_t::copy_construct_nothrow;
15207 using base_t::move_construct_nothrow;
15208 using base_t::construct_nothrow;
15209 using base_t::destruct_nothrow;
15210 using base_t::clear_nothrow;
15211 using base_t::ptr_reset_nothrow;
15212 using base_t::hash_nothrow;
15213 using base_t::get_data_nothrow;
15214 using base_t::apply_data_nothrow;
15215 using base_t::set_hash_cache;
15219 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{nothing;}
15220 [[nodiscard]]
virtual char_T* get_c_str(ptr_t&)
noexcept override final{
15221 static char_T data[1]{};
15224 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return 0; }
15225 [[nodiscard]]
virtual ptr_t get_substr_data([[maybe_unused]]
size_t begin,[[maybe_unused]]
size_t size)
noexcept override final{
return this; }
15226 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
return get<comn_string_data_t<char_T>>(str); }
15227 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
return str; }
15228 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
return get<comn_string_data_t<char_T>>(str); }
15229 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept override final{
return str; }
15231 [[nodiscard]]
virtual ptr_t do_insert([[maybe_unused]]
size_t pos,[[maybe_unused]]string_view_t str)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
return get<comn_string_data_t<char_T>>(str); }
15232 [[nodiscard]]
virtual ptr_t do_insert([[maybe_unused]]
size_t pos,[[maybe_unused]]ptr_t str)
noexcept override final{
return str; }
15233 [[nodiscard]]
virtual ptr_t do_erase([[maybe_unused]]
size_t pos,[[maybe_unused]]
size_t size)
noexcept override final{
return this; }
15235 virtual void copy_part_data_to([[maybe_unused]]char_T* to,[[maybe_unused]]
size_t pos,[[maybe_unused]]
size_t size)
noexcept override final{
return; }
15237 [[nodiscard]]
virtual char_T arec([[maybe_unused]]
size_t index)
noexcept override final{
return char_T{}; }
15238 virtual void arec_set([[maybe_unused]]
size_t index,[[maybe_unused]]char_T a,[[maybe_unused]]ptr_t& p)
noexcept override final{ nothing; }
15239 [[nodiscard]]
virtual ptr_t do_pop_back([[maybe_unused]]
size_t size,[[maybe_unused]]ptr_t& self)
noexcept override final{
return this; }
15240 [[nodiscard]]
virtual ptr_t do_pop_front([[maybe_unused]]
size_t size,[[maybe_unused]]ptr_t& self)
noexcept override final{
return this; }
15242 virtual hash_t get_hash_detail([[maybe_unused]]ptr_t&p)
noexcept override final{
return hash(nothing); }
15243 virtual hash_t get_others_hash_with_calculated_before_detail([[maybe_unused]]
hash_t before,[[maybe_unused]]
size_t before_size,[[maybe_unused]]ptr_t&p,[[maybe_unused]]
size_t pos,[[maybe_unused]]
size_t size)
noexcept override final{
return before; }
15245 [[nodiscard]]
virtual bool same_struct(ptr_t)
noexcept override final{
return false;}
15246 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form([[maybe_unused]]
size_t begin)
noexcept override final{
return {0,0};}
15247 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept override final{
return false;}
15248 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept override final{
return strong_ordering::equivalent;}
15249 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
return 0;}
15251 template<
typename char_T>
15253 template<
typename char_T>
15254 base_string_data_t<char_T>* the_get_null_ptr(
const base_string_data_t<char_T>*)
noexcept{
return&null_string_data<char_T>; }
15258 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15259 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/constexpr_string_data_t.hpp"
15268 template<
typename char_T>
15272 using base_t::ptr_t;
15273 using base_t::string_view_t;
15275 using base_t::copy_assign_nothrow;
15276 using base_t::copy_construct_nothrow;
15277 using base_t::move_construct_nothrow;
15278 using base_t::construct_nothrow;
15279 using base_t::destruct_nothrow;
15280 using base_t::clear_nothrow;
15281 using base_t::ptr_reset_nothrow;
15282 using base_t::hash_nothrow;
15283 using base_t::get_data_nothrow;
15284 using base_t::apply_data_nothrow;
15285 using base_t::set_hash_cache;
15292 bool match_pattern_by_get = 0;
15294 void clear_match_pattern()
noexcept{
15295 if(match_pattern_by_get){
15296 unget(remove_const(_p_match_pattern));
15297 unget(remove_const(_p_reverse_match_pattern));
15298 _p_match_pattern =
nullptr;
15299 _p_reverse_match_pattern =
nullptr;
15306 set_hash_cache(hash(str));
15307 _p_match_pattern=&str.match_pattern;
15308 _p_reverse_match_pattern=&str.reverse_match_pattern;
15309 match_pattern_by_get=0;
15315 be_replace_as(null_ptr);
15318 clear_match_pattern();
15321 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
15322 return get<this_t>(string_view_t{_m+begin,size});
15324 [[nodiscard]]
virtual const char_T* get_data(ptr_t&)
noexcept(get_data_nothrow)
override final{
return _m;}
15325 [[nodiscard]]
virtual const char_T* get_const_c_str(ptr_t&p)
noexcept(get_data_nothrow)
override final{
15329 return base_t::get_const_c_str(p);
15331 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _size; }
15333 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{ copy_assign[size](note::from(_m+pos),note::to(to)); }
15335 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
return _m[index]; }
15337 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{base_t::be_replace_as(a);}
15338 virtual void arec_set(
size_t index,char_T a,ptr_t&p)
noexcept override final{base_t::arec_set(index,a,p);}
15340 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
15343 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
return {&_m[begin],note::size(_size-begin)};}
15344 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
15345 auto wp=down_cast<this_t*>(with.get());
15348 return equal(_m,wp->_m,_size);
15350 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
15351 auto wp=down_cast<this_t*>(with.get());
15353 return strong_ordering::equivalent;
15354 return compare(_m,wp->_m,_size);
15357 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
15358 return float_size_of(*
this);
15362 if(!_p_match_pattern){
15363 _p_match_pattern=get<range_n::match_pattern<const char_T>>(
array_like_view_t{this->get_data(self),this->get_size()});
15364 match_pattern_by_get = 1;
15366 return *_p_match_pattern;
15369 if(!_p_reverse_match_pattern){
15370 _p_reverse_match_pattern=get<range_n::reverse_match_pattern<const char_T>>(
array_like_view_t{this->get_data(self),this->get_size()});
15371 match_pattern_by_get = 1;
15373 return *_p_reverse_match_pattern;
15379 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15381 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/comn_string_data_t.hpp"
15390 template<
typename char_T>
15394 using base_t::ptr_t;
15395 using base_t::string_view_t;
15396 using base_t::self_changed;
15398 using base_t::copy_assign_nothrow;
15399 using base_t::copy_construct_nothrow;
15400 using base_t::move_construct_nothrow;
15401 using base_t::construct_nothrow;
15402 using base_t::destruct_nothrow;
15403 using base_t::clear_nothrow;
15404 using base_t::ptr_reset_nothrow;
15405 using base_t::hash_nothrow;
15406 using base_t::get_data_nothrow;
15407 using base_t::apply_data_nothrow;
15408 using base_t::set_hash_cache;
15410 array_t<char_T> _m;
15413 void clear_match_pattern()
noexcept{
15414 unget(_p_match_pattern);
15415 unget(_p_reverse_match_pattern);
15416 base_t::self_changed();
15418 void self_changed()
noexcept{
15419 clear_match_pattern();
15420 base_t::self_changed();
15423 comn_string_data_t(string_view_t str)
noexcept(construct_nothrow&©_assign_nothrow):_m(note::size(str.size()+1)){
15424 copy_assign[str.size()](note::from(str.begin()),note::to((char_T*)_m));
15425 _m[str.size()]=zero;
15427 comn_string_data_t(ptr_t str)
noexcept(construct_nothrow&©_assign_nothrow):_m(note::size(str->get_size()+1)){
15428 auto size=this->get_size();
15429 str->copy_part_data_to((char_T*)_m,0,size);
15432 comn_string_data_t(ptr_t str,
size_t pos,
size_t size)
noexcept(construct_nothrow&©_assign_nothrow):_m(note::size(size+1)){
15433 str->copy_part_data_to((char_T*)_m,pos,size);
15436 comn_string_data_t(
size_t size,char_T ch)
noexcept(construct_nothrow&©_assign_nothrow):_m(note::size(size+1),ch){
15439 comn_string_data_t(
size_t size)
noexcept(construct_nothrow&©_assign_nothrow):_m(note::size(size+1)){
15444 clear_match_pattern();
15447 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
15449 base_t::be_replace_as(a);
15451 [[nodiscard]]
virtual char_T* get_c_str(ptr_t&)
noexcept override final{
return (char_T*)_m; }
15452 [[nodiscard]]
virtual char_T* get_unique_c_str(ptr_t&p)
noexcept(get_data_nothrow)
override final{
15453 if(this->is_unique())
15454 return (char_T*)_m;
15456 return base_t::get_unique_c_str(p);
15458 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _m.size()-1; }
15460 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{ copy_assign[size](note::from((
const char_T*)_m+pos),note::to(to)); }
15462 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
return _m[index]; }
15463 virtual void arec_set(
size_t index,char_T a,ptr_t&p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
15464 if(this->is_unique()){
15465 copy_assign(_m[index],a);
15469 base_t::arec_set(index,a,p);
15472 [[nodiscard]]
virtual bool same_struct(ptr_t)
noexcept override final{
15475 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
return {&_m[begin],note::size(get_size()-begin)};}
15476 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
15477 auto wp=down_cast<this_t*>(with.get());
15478 return equal(_m, wp->_m);
15480 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
15481 auto wp=down_cast<this_t*>(with.get());
15482 return compare(_m, wp->_m);
15485 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
15486 return float_size_of(*
this) + _m.size_in_byte();
15490 if(!_p_match_pattern){
15491 _p_match_pattern=get<range_n::match_pattern<const char_T>>(
array_like_view_t{this->get_data(self),this->get_size()});
15493 return *_p_match_pattern;
15496 if(!_p_reverse_match_pattern){
15497 _p_reverse_match_pattern=get<range_n::reverse_match_pattern<const char_T>>(
array_like_view_t{this->get_data(self),this->get_size()});
15499 return *_p_reverse_match_pattern;
15502 template<
typename char_T>
15504 auto comn_data=get<comn_string_data_t<char_T>>(
this);
15505 if(positive_gc_profit())
15506 a.do_replace(comn_data);
15509 return comn_data->get_c_str(a);
15511 template<
typename char_T>
15512 [[nodiscard]]char_T* base_string_data_t<char_T>::get_unique_c_str(ptr_t&a)
noexcept(get_data_nothrow){
15513 auto comn_data=get<comn_string_data_t<char_T>>(
this);
15515 return comn_data->get_c_str(a);
15517 template<
typename char_T>
15518 void base_string_data_t<char_T>::arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow){
15519 copy_assign(this->get_unique_c_str(p)[index],a);
15521 template<
typename char_T>
15522 [[nodiscard]]float_size_t base_string_data_t<char_T>::get_memory_cost_after_gc()noexcept{
15523 const auto size_of_base_array=this->get_size()*
sizeof(char_T);
15524 const auto size=float_size_of(comn_string_data_t<char_T>)+size_of_base_array;
15525 return size/get_ref_num(
this);
15527 template<
typename char_T>
15528 [[nodiscard]]
const range_n::match_pattern<const char_T>& base_string_data_t<char_T>::get_match_pattern_from_self(ptr_t&self)
noexcept(copy_assign_nothrow&&move_construct_nothrow){
15529 auto comn_data=get<comn_string_data_t<char_T>>(
this);
15531 return comn_data->get_match_pattern_from_self(self);
15533 template<
typename char_T>
15534 [[nodiscard]]
const range_n::reverse_match_pattern<const char_T>& base_string_data_t<char_T>::get_reverse_match_pattern_from_self(ptr_t&self)
noexcept(copy_assign_nothrow&&move_construct_nothrow){
15535 auto comn_data=get<comn_string_data_t<char_T>>(
this);
15537 return comn_data->get_reverse_match_pattern_from_self(self);
15542 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15544 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/substr_string_data_t.hpp"
15553 template<
typename char_T>
15557 using base_t::ptr_t;
15558 using base_t::string_view_t;
15559 using base_t::self_changed;
15561 using base_t::copy_assign_nothrow;
15562 using base_t::copy_construct_nothrow;
15563 using base_t::move_construct_nothrow;
15564 using base_t::construct_nothrow;
15565 using base_t::destruct_nothrow;
15566 using base_t::clear_nothrow;
15567 using base_t::ptr_reset_nothrow;
15568 using base_t::hash_nothrow;
15569 using base_t::get_data_nothrow;
15570 using base_t::apply_data_nothrow;
15571 using base_t::set_hash_cache;
15577 void null_equivalent_check()
noexcept{
15579 be_replace_as(null_ptr);
15582 substr_string_data_t(ptr_t str,
size_t sub_begin,
size_t sub_size)
noexcept:_to(str),_sub_begin(sub_begin),_sub_size(sub_size){
15583 null_equivalent_check();
15586 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
15588 base_t::be_replace_as(a);
15590 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
return get<substr_string_data_t<char_T>>(_to,begin+_sub_begin,size); }
15591 [[nodiscard]]
virtual const char_T* get_const_c_str(ptr_t&p)
noexcept(get_data_nothrow)
override final{
15592 if(_sub_begin+_sub_size==_to->get_size())
15593 return _to->get_const_c_str(_to)+_sub_begin;
15595 return base_t::get_const_c_str(p);
15597 [[nodiscard]]
virtual const char_T* get_data(ptr_t&)
noexcept(get_data_nothrow)
override final{
return _to->get_data(_to)+_sub_begin; }
15598 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _sub_size; }
15600 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{ _to->copy_part_data_to(to,pos+_sub_begin,size); }
15602 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
return _to->arec(index+_sub_begin); }
15603 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
15604 if(this->is_unique()){
15605 _to->arec_set(index+_sub_begin,a,_to);
15609 base_t::arec_set(index,a,p);
15611 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
15612 if(this->is_unique() && _sub_begin==0){
15613 _to=_to->apply_str_to_begin(str);
15614 _sub_size+=str.size();
15619 return base_t::apply_str_to_begin(str);
15621 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
15622 if(this->is_unique() && _sub_begin==0){
15623 _to=_to->apply_str_to_begin(str);
15624 _sub_size+=str->get_size();
15629 return base_t::apply_str_to_begin(str);
15631 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
15632 if(this->is_unique() && _sub_begin+_sub_size==_to->get_size()){
15633 _to=_to->apply_str_to_end(str);
15634 _sub_size+=str.size();
15639 return base_t::apply_str_to_end(str);
15641 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow)
override final{
15642 if(this->is_unique() && _sub_begin+_sub_size==_to->get_size()){
15643 _to=_to->apply_str_to_end(str);
15644 _sub_size+=str->get_size();
15649 return base_t::apply_str_to_end(str);
15651 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
15652 if(this->is_unique() && _sub_begin==0){
15653 auto aret=_to->do_pop_front(size,_to);
15655 null_equivalent_check();
15660 return base_t::do_pop_front(size,self);
15662 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
15663 if(this->is_unique() && _sub_begin+_sub_size==_to->get_size()){
15664 auto aret=_to->do_pop_back(size,_to);
15666 null_equivalent_check();
15671 return base_t::do_pop_back(size,self);
15674 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
15675 auto result=hash(nothing);
15676 result=_to->get_others_hash_with_calculated_before(result,0,_to,_sub_begin,_sub_size);
15679 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
15680 return _to->get_others_hash_with_calculated_before(before,before_size,_to,pos+_sub_begin,size);
15683 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
15684 auto wp = down_cast<this_t*>(with.get());
15685 return _sub_begin == wp->_sub_begin;
15687 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
15688 auto result = _to->get_the_largest_complete_data_block_begin_form(_sub_begin+begin);
15689 auto size = min(result.size(),_sub_size-begin);
15690 return {result.begin(), note::size(size)};
15692 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
15693 auto wp=down_cast<this_t*>(with.get());
15694 return _to->equal_with(wp->_to,_sub_begin,_sub_size);
15696 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
15697 auto wp=down_cast<this_t*>(with.get());
15698 return _to->compare_with(wp->_to,_sub_begin,_sub_size);
15700 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
15701 return float_size_of(*
this)+_to->get_memory_cost();
15704 template<
typename char_T>
15706 if(begin==0&&size==get_size())
15709 return get<substr_string_data_t<char_T>>(
this,begin,size);
15714 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15716 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/head_apply_string_data_t.hpp"
15725 template<
typename char_T>
15729 using base_t::ptr_t;
15730 using base_t::string_view_t;
15731 using base_t::self_changed;
15733 using base_t::copy_assign_nothrow;
15734 using base_t::copy_construct_nothrow;
15735 using base_t::move_construct_nothrow;
15736 using base_t::construct_nothrow;
15737 using base_t::destruct_nothrow;
15738 using base_t::clear_nothrow;
15739 using base_t::ptr_reset_nothrow;
15740 using base_t::hash_nothrow;
15741 using base_t::get_data_nothrow;
15742 using base_t::apply_data_nothrow;
15743 using base_t::set_hash_cache;
15745 array_t<char_T> _m;
15751 _to_size(str->get_size()),
15752 _used_size(head.size()),
15755 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
15756 copy_assign[_used_size](note::from<const char_T*>(head.begin()),note::to<char_T*>(_m.end()-_used_size));
15759 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
15760 if(begin>=_used_size)
15761 return _to->get_substr_data(begin-_used_size,size);
15763 return base_t::get_substr_data(begin,size);
15765 [[nodiscard]]
virtual char_T* get_c_str(ptr_t&p)
noexcept(get_data_nothrow)
override final{
15767 return _to->get_c_str(_to);
15769 return base_t::get_c_str(p);
15771 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
15772 if(type_info<this_t> ==
typeid(*a)){
15773 const auto p = down_cast<this_t*>(a.get());
15774 if(_used_size==p->_used_size && _to!=p->_to)
15775 base_t::equivalent_optimization(_to, p->_to);
15779 base_t::be_replace_as(a);
15781 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _used_size+_to_size; }
15782 [[nodiscard]]
virtual ptr_t do_insert(
size_t pos,string_view_t str)
noexcept(copy_construct_nothrow)
override final{
15784 return this->apply_str_to_begin(str);
15785 elseif(pos==get_size())
15786 return this->apply_str_to_end(str);
15787 elseif(this->is_unique()){
15788 if(pos<_used_size){
15789 if(_m.size()-_used_size<str.size()){
15790 const auto size_now=this->get_size()+str.size();
15791 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
15792 _m.insert_with_forward_resize(pos,str.size(),str.begin(),size_new);
15795 char_T* orogin_head_begin=_m.end()-_used_size;
15796 char_T* head_begin=orogin_head_begin-str.size();
15797 copy_assign[pos](note::from<const char_T*>(orogin_head_begin),note::to<char_T*>(head_begin));
15798 copy_assign[str.size()](note::from<const char_T*>(str.begin()),note::to<char_T*>(head_begin+pos));
15800 _used_size+=str.size();
15804 return _to->do_insert(pos-_used_size,str);
15807 return base_t::do_insert(pos,str);
15810 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{
15811 if(pos<_used_size){
15812 const char_T* head_begin=_m.end()-_used_size;
15813 const char_T* head_end=_m.end();
15814 const char_T* copy_begin=pos+head_begin;
15815 size_t size_of_copy_from_head=min(
size_t(head_end-copy_begin),size);
15817 copy_assign[size_of_copy_from_head](note::from(copy_begin),note::to(to));
15818 if(size!=size_of_copy_from_head){
15819 const size_t size_left=size-size_of_copy_from_head;
15820 char_T* next_copy_begin_pos=to+size_of_copy_from_head;
15821 _to->copy_part_data_to(next_copy_begin_pos,0,size_left);
15825 _to->copy_part_data_to(to,pos-_used_size,size);
15828 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
15829 if(index<_used_size){
15830 const char_T* head_begin=_m.end()-_used_size;
15831 return head_begin[index];
15834 return _to->arec(index-_used_size);
15836 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
15837 if(this->is_unique()){
15838 if(index<_used_size){
15839 char_T* head_begin=_m.end()-_used_size;
15840 copy_assign(head_begin[index],a);
15843 _to->arec_set(index-_used_size,a,_to);
15847 base_t::arec_set(index,a,p);
15849 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
15850 if(this->is_unique()){
15851 if(_m.size()-_used_size<str.size()){
15852 const auto size_now=this->get_size()+str.size();
15853 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
15854 _m.insert_with_forward_resize(0,str.size(),str.begin(),size_new);
15857 copy_assign[str.size()](note::from<const char_T*>(str.begin()),note::to<char_T*>(_m.end()-_used_size-str.size()));
15858 _used_size+=str.size();
15863 return base_t::apply_str_to_begin(str);
15865 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
15867 return base_t::apply_str_to_begin(str);
15869 void shrink()
noexcept(_m.forward_resize_nothrow){
15870 _m.forward_resize(_used_size);
15872 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
15873 if(this->is_unique()){
15874 _to=_to->apply_str_to_end(str);
15875 _to_size+=str.size();
15880 return base_t::apply_str_to_end(str);
15882 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow)
override final{
15883 if(this->is_unique()){
15884 _to=_to->apply_str_to_end(str);
15885 _to_size+=str->get_size();
15890 return base_t::apply_str_to_end(str);
15892 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
15893 if(this->is_unique() && _used_size>=size){
15896 return get<comn_string_data_t<char_T>>(string_view_t{(char_T*)_m.end()-_used_size-size,size});
15899 return base_t::do_pop_front(size,self);
15901 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
15902 if(this->is_unique()){
15903 auto aret=_to->do_pop_back(size,_to);
15909 return base_t::do_pop_back(size,self);
15912 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
15913 suppress_msvc_warning(26494)
15916 const char_T* head_begin=_m.end()-_used_size;
15917 result=hash(head_begin,_used_size);
15919 result=hash.merge_array_hash_results(result,_used_size,_to->get_hash(_to),_to_size);
15922 result=_to->get_hash(_to);
15925 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
15926 if(pos<_used_size){
15927 const char_T* head_begin=_m.end()-_used_size;
15928 const char_T* head_end=_m.end();
15929 const char_T* calculate_begin=pos+head_begin;
15930 const size_t size_of_calculate_from_head=min(
size_t(head_end-calculate_begin),size);
15932 before=hash.with_calculated_before(before,before_size,calculate_begin,size_of_calculate_from_head);
15933 if(size!=size_of_calculate_from_head){
15934 const size_t size_left=size-size_of_calculate_from_head;
15935 before_size+=size_of_calculate_from_head;
15936 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,0,size_left);
15940 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos-_used_size,size);
15944 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
15945 auto wp=down_cast<this_t*>(with.get());
15946 return _used_size==wp->_used_size;
15948 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
15949 if(begin >= _used_size)
15950 return _to->get_the_largest_complete_data_block_begin_form(begin-_used_size);
15952 const char_T* head_begin = _m.end() - _used_size;
15953 const char_T* head_end = _m.end();
15954 const char_T* ret_begin = begin+head_begin;
15955 return {ret_begin, head_end};
15958 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
15959 auto wp=down_cast<this_t*>(with.get());
15960 const char_T* head_begin = _m.end() - _used_size;
15961 const char_T* wp_head_begin = wp->_m.end() - _used_size;
15962 if(!equal(head_begin,wp_head_begin,_used_size))
15964 return _to->equal_with(wp->_to);
15966 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
15967 auto wp=down_cast<this_t*>(with.get());
15968 const char_T* head_begin = _m.end() - _used_size;
15969 const char_T* wp_head_begin = wp->_m.end() - _used_size;
15970 if(
auto tmp=compare(head_begin,wp_head_begin,_used_size); tmp!=0)
15972 return _to->compare_with(wp->_to);
15974 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
15975 return _to->get_memory_cost()+float_size_of(*
this)+_m.size_in_byte();
15978 template<
typename char_T>
15988 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
15989 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/end_apply_string_data_t.hpp"
15998 template<
typename char_T>
16002 using base_t::ptr_t;
16003 using base_t::string_view_t;
16004 using base_t::self_changed;
16006 using base_t::copy_assign_nothrow;
16007 using base_t::copy_construct_nothrow;
16008 using base_t::move_construct_nothrow;
16009 using base_t::construct_nothrow;
16010 using base_t::destruct_nothrow;
16011 using base_t::clear_nothrow;
16012 using base_t::ptr_reset_nothrow;
16013 using base_t::hash_nothrow;
16014 using base_t::get_data_nothrow;
16015 using base_t::apply_data_nothrow;
16016 using base_t::set_hash_cache;
16018 array_t<char_T> _m;
16024 _to_size(str->get_size()),
16025 _used_size(end.size()),
16028 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
16029 copy_assign[_used_size](note::from(end.begin()),note::to((char_T*)_m));
16032 _to_size(str->get_size()),
16036 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
16037 copy_assign[_used_size](ch,note::to((char_T*)_m));
16040 _to_size(str->get_size()),
16044 _m.resize(get_next_gold_size_to_resize_for_array(_to_size+_used_size));
16047 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
16048 if(begin+size<=_to_size)
16049 return _to->get_substr_data(begin,size);
16051 return base_t::get_substr_data(begin,size);
16053 [[nodiscard]]
virtual char_T* get_c_str(ptr_t&p)
noexcept(get_data_nothrow)
override final{
16055 return _to->get_c_str(_to);
16057 return base_t::get_c_str(p);
16059 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
16060 if(type_info<this_t> ==
typeid(*a)){
16061 const auto p = down_cast<this_t*>(a.get());
16062 if(_used_size==p->_used_size && _to!=p->_to)
16063 base_t::equivalent_optimization(_to, p->_to);
16067 base_t::be_replace_as(a);
16069 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _used_size+_to_size; }
16070 [[nodiscard]]
virtual ptr_t do_insert(
size_t pos,string_view_t str)
noexcept(copy_construct_nothrow)
override final{
16072 return this->apply_str_to_begin(str);
16073 elseif(pos==get_size())
16074 return this->apply_str_to_end(str);
16075 elseif(this->is_unique()){
16077 return _to->do_insert(pos-_used_size,str);
16080 if(_m.size()-_used_size<str.size()){
16081 const auto size_now=this->get_size()+str.size();
16082 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
16083 _m.insert_with_resize(pos,str.size(),str.begin(),size_new);
16086 copy_assign[_used_size-pos](note::from<const char_T*>(&_m[pos]),note::to((char_T*)&_m[pos+str.size()]));
16087 copy_assign[str.size()](note::from<const char_T*>(str.begin()),note::to<char_T*>(&_m[pos]));
16089 _used_size+=str.size();
16095 return base_t::do_insert(pos,str);
16098 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{
16099 if(pos+size<=_to_size)
16100 _to->copy_part_data_to(to,pos,size);
16103 _to->copy_part_data_to(to,pos,_to_size-pos);
16104 auto copied_size=_to_size-pos;
16111 copy_assign[size](note::from((
const char_T*)_m+pos),note::to(to));
16115 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
16117 return _to->arec(index);
16119 return _m[index-_to_size];
16121 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
16122 if(this->is_unique()){
16124 _to->arec_set(index,a,_to);
16126 copy_assign(_m[index - _to_size],a);
16130 base_t::arec_set(index,a,p);
16133 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16134 if(this->is_unique()){
16135 if(_m.size()-_used_size < str.size()){
16136 const auto size_now=this->get_size()+str.size();
16137 const auto size_new=get_next_gold_size_to_resize_for_array(size_now);
16138 _m.insert_with_resize(_used_size,str.size(),str.begin(),size_new);
16141 copy_assign[str.size()](note::from(str.begin()),note::to((char_T*)_m+_used_size));
16142 _used_size+=str.size();
16147 return base_t::apply_str_to_end(str);
16149 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16151 return base_t::apply_str_to_end(str);
16153 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16154 if(this->is_unique()){
16155 _to=_to->apply_str_to_begin(str);
16156 _to_size+=str.size();
16161 return base_t::apply_str_to_begin(str);
16163 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16164 if(this->is_unique()){
16165 _to=_to->apply_str_to_begin(str);
16166 _to_size+=str->get_size();
16171 return base_t::apply_str_to_begin(str);
16173 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16174 if(this->is_unique()){
16175 auto aret=_to->do_pop_front(size,_to);
16181 return base_t::do_pop_front(size,self);
16183 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16184 if(this->is_unique() && _used_size>=size){
16187 return get<comn_string_data_t<char_T>>(string_view_t{(char_T*)_m+_used_size,size});
16190 return base_t::do_pop_back(size,self);
16193 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
16194 return hash.with_calculated_before(_to->get_hash(_to),_to_size,string_view_t(_m.begin(),_used_size));
16196 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
16197 if(pos+size<=_to_size)
16198 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size);
16201 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,_to_size-pos);
16202 const auto calculated_size=_to_size-pos;
16204 size-=calculated_size;
16205 before_size+=calculated_size;
16209 before=hash.with_calculated_before(before,before_size,(
const char_T*)_m+pos,size);
16213 void shrink()
noexcept(_m.resize_nothrow){
16214 _m.resize(_used_size);
16217 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
16218 auto wp = down_cast<this_t*>(with.get());
16219 return _used_size==wp->_used_size;
16221 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
16222 if(begin < _to_size){
16223 return _to->get_the_largest_complete_data_block_begin_form(begin);
16227 return {_m.begin()+begin,note::size(_used_size-begin)};
16230 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
16231 auto wp=down_cast<this_t*>(with.get());
16232 if(!_to->equal_with(wp->_to))
16234 return equal((char_T*)_m.begin(),(char_T*)wp->_m.begin(),_used_size);
16236 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
16237 auto wp=down_cast<this_t*>(with.get());
16238 if(
auto tmp=_to->compare_with(wp->_to); tmp!=0)
16240 return compare((char_T*)_m.begin(),(char_T*)wp->_m.begin(),_used_size);
16242 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
16243 return _to->get_memory_cost()+float_size_of(*
this)+_m.size_in_byte();
16246 template<
typename char_T>
16256 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16258 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/sum_string_data_t.hpp"
16267 template<
typename char_T>
16271 using base_t::ptr_t;
16272 using base_t::string_view_t;
16273 using base_t::self_changed;
16275 using base_t::copy_assign_nothrow;
16276 using base_t::copy_construct_nothrow;
16277 using base_t::move_construct_nothrow;
16278 using base_t::construct_nothrow;
16279 using base_t::destruct_nothrow;
16280 using base_t::clear_nothrow;
16281 using base_t::ptr_reset_nothrow;
16282 using base_t::hash_nothrow;
16283 using base_t::get_data_nothrow;
16284 using base_t::apply_data_nothrow;
16285 using base_t::set_hash_cache;
16289 size_t _before_size;
16290 size_t _after_size;
16292 sum_string_data_t(ptr_t before,ptr_t after)
noexcept:_before(before),_after(after),_before_size(_before->get_size()),_after_size(_after->get_size()){
16294 be_replace_as(_after);
16295 elseif(!_after_size)
16296 be_replace_as(_before);
16299 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
16300 if(begin+size<=_before_size)
16301 return _before->get_substr_data(begin,size);
16302 elseif(begin>=_before_size)
16303 return _after->get_substr_data(begin-_before_size,size);
16305 return base_t::get_substr_data(begin,size);
16307 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
16308 if(type_info<this_t> ==
typeid(*a)){
16309 const auto p = down_cast<this_t*>(a.get());
16310 if(_before_size==p->_before_size){
16311 if(_before!=p->_before)
16312 base_t::equivalent_optimization(_before, p->_before);
16313 if(_after!=p->_after)
16314 base_t::equivalent_optimization(_after, p->_after);
16319 base_t::be_replace_as(a);
16321 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _before_size+_after_size; }
16323 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{
16324 if(pos<_before_size){
16325 const auto copy_before_begin=pos;
16326 const auto copy_before_end=min(pos+size,_before_size);
16327 const auto copy_before_size=copy_before_end-copy_before_begin;
16328 _before->copy_part_data_to(to,copy_before_begin,copy_before_size);
16329 if(size!=copy_before_size){
16330 const auto copy_after_size=size-copy_before_size;
16331 to+=copy_before_size;
16332 _after->copy_part_data_to(to,0,copy_after_size);
16336 _after->copy_part_data_to(to,pos-_before_size,size);
16339 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
16340 if(index<_before_size)
16341 return _before->arec(index);
16343 return _after->arec(index-_before_size);
16345 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
16346 if(this->is_unique()){
16347 if(index<_before_size)
16348 _before->arec_set(index,a,_before);
16350 _after->arec_set(index-_before_size,a,_after);
16354 base_t::arec_set(index,a,p);
16356 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16357 if(this->is_unique()){
16358 _before=_before->apply_str_to_begin(str);
16359 _before_size+=str.size();
16364 return base_t::apply_str_to_begin(str);
16366 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16367 if(this->is_unique()){
16368 _before=_before->apply_str_to_begin(str);
16369 _before_size+=str->get_size();
16374 return base_t::apply_str_to_begin(str);
16376 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16377 if(this->is_unique()){
16378 _after=_after->apply_str_to_end(str);
16379 _after_size+=str.size();
16384 return base_t::apply_str_to_end(str);
16386 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16387 if(this->is_unique()){
16388 _after=_after->apply_str_to_end(str);
16389 _after_size+=str->get_size();
16394 return base_t::apply_str_to_end(str);
16396 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16397 if(this->is_unique() && _before_size>=size){
16399 if(_before_size==size)
16400 swap(aret,_before);
16402 aret=_before->do_pop_front(size,_before);
16403 _before_size-=size;
16405 be_replace_as(_after);
16410 return base_t::do_pop_front(size,self);
16412 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16413 if(this->is_unique() && _after_size>=size){
16415 if(_before_size==size)
16418 aret=_after->do_pop_back(size,_after);
16421 be_replace_as(_before);
16426 return base_t::do_pop_back(size,self);
16429 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
16430 suppress_msvc_warning(26494)
16433 result=_before->get_hash(_before);
16435 result=hash.merge_array_hash_results(result,_before_size,_after->get_hash(_after),_after_size);
16438 result=_after->get_hash(_after);
16441 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
16442 if(pos<_before_size){
16443 const auto calculate_before_begin=pos;
16444 const auto calculate_before_end=min(pos+size,_before_size);
16445 const auto calculate_before_size=calculate_before_end-calculate_before_begin;
16446 before=_before->get_others_hash_with_calculated_before(before,before_size,_before,calculate_before_begin,calculate_before_size);
16447 if(size!=calculate_before_size){
16448 const auto calculate_after_size=size-calculate_before_size;
16449 before_size+=calculate_before_size;
16450 before=_after->get_others_hash_with_calculated_before(before,before_size,_after,0,calculate_after_size);
16454 before=_after->get_others_hash_with_calculated_before(before,before_size,_after,pos-_before_size,size);
16458 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
16459 auto wp=down_cast<this_t*>(with.get());
16460 return _before_size==wp->_before_size;
16462 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
16463 if(begin < _before_size)
16464 return _before->get_the_largest_complete_data_block_begin_form(begin);
16466 return _after->get_the_largest_complete_data_block_begin_form(begin - _before_size);
16468 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
16469 auto wp=down_cast<this_t*>(with.get());
16470 if(!this->_before->equal_with(wp->_before))
16472 return this->_after->equal_with(wp->_after);
16474 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
16475 auto wp=down_cast<this_t*>(with.get());
16476 if(
auto tmp=this->_before->compare_with(wp->_before); tmp!=0)
16478 return this->_after->compare_with(wp->_after);
16480 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
16481 return float_size_of(*
this)+_before->get_memory_cost()+_after->get_memory_cost();
16484 template<
typename char_T>
16486 return get<sum_string_data_t<char_T>>(
this,str);
16488 template<
typename char_T>
16490 return get<sum_string_data_t<char_T>>(str,
this);
16495 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16497 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/erased_string_data_t.hpp"
16506 template<
typename char_T>
16510 using base_t::ptr_t;
16511 using base_t::string_view_t;
16512 using base_t::self_changed;
16514 using base_t::copy_assign_nothrow;
16515 using base_t::copy_construct_nothrow;
16516 using base_t::move_construct_nothrow;
16517 using base_t::construct_nothrow;
16518 using base_t::destruct_nothrow;
16519 using base_t::clear_nothrow;
16520 using base_t::ptr_reset_nothrow;
16521 using base_t::hash_nothrow;
16522 using base_t::get_data_nothrow;
16523 using base_t::apply_data_nothrow;
16524 using base_t::set_hash_cache;
16529 size_t _erase_size;
16531 void null_equivalent_check()
noexcept{
16532 if(_to_size==_erase_size || !_to_size)
16533 be_replace_as(null_ptr);
16536 erased_string_data_t(ptr_t str,
size_t erase_pos,
size_t erase_size)
noexcept:_to(str),_to_size(_to->get_size()),_erase_pos(erase_pos),_erase_size(erase_size){
16537 null_equivalent_check();
16540 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
16541 if(begin+size<_erase_pos)
16542 return _to->get_substr_data(begin,size);
16543 elseif(begin>_erase_pos)
16544 return _to->get_substr_data(begin+_erase_size,size);
16546 return base_t::get_substr_data(begin,size);
16548 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final {
16549 if(type_info<this_t> ==
typeid(*a)){
16550 const auto p = down_cast<this_t*>(a.get());
16551 if(_erase_pos==p->_erase_pos && _erase_size==p->_erase_size && _to!=p->_to)
16552 base_t::equivalent_optimization(_to, p->_to);
16555 base_t::be_replace_as(a);
16557 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _to_size-_erase_size; }
16559 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{
16560 if(pos+size<_erase_pos)
16561 _to->copy_part_data_to(to,pos,size);
16562 elseif(pos>_erase_pos)
16563 _to->copy_part_data_to(to,pos+_erase_size,size);
16565 const auto size_before_erase_pos=_erase_pos-pos;
16566 const auto size_after_erase_pos=size-size_before_erase_pos;
16567 _to->copy_part_data_to(to,pos,size_before_erase_pos);
16568 _to->copy_part_data_to(to+size_before_erase_pos,_erase_pos+_erase_size,size_after_erase_pos);
16572 [[nodiscard]]
virtual ptr_t do_erase(
size_t pos,
size_t size)
noexcept override final{
16573 if(this->is_unique()){
16574 if(pos<=_erase_pos && pos+size>=_erase_pos+_erase_size){
16581 return base_t::do_erase(pos,size);
16583 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
16584 if(index>_erase_pos)
16585 return _to->arec(index+_erase_size);
16587 return _to->arec(index);
16590 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
16591 if(this->is_unique()){
16592 if(index>_erase_pos)
16593 _to->arec_set(index+_erase_size,a,_to);
16595 _to->arec_set(index,a,_to);
16599 base_t::arec_set(index,a,p);
16601 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16602 if(this->is_unique()){
16603 _to=_to->apply_str_to_begin(str);
16604 const auto strsize=str.size();
16606 _erase_pos+=strsize;
16611 return base_t::apply_str_to_begin(str);
16613 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16614 if(this->is_unique()){
16615 _to=_to->apply_str_to_begin(str);
16616 const auto strsize=str->get_size();
16618 _erase_pos+=strsize;
16623 return base_t::apply_str_to_begin(str);
16625 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16626 if(this->is_unique()){
16627 _to=_to->apply_str_to_end(str);
16628 _to_size+=str.size();
16633 return base_t::apply_str_to_end(str);
16635 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16636 if(this->is_unique()){
16637 _to=_to->apply_str_to_end(str);
16638 _to_size+=str->get_size();
16643 return base_t::apply_str_to_end(str);
16645 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16646 if(this->is_unique() && _erase_pos > size){
16647 auto aret=_to->do_pop_front(size,_to);
16650 null_equivalent_check();
16655 return base_t::do_pop_front(size,self);
16657 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16658 if(this->is_unique() && _erase_pos+_erase_size <= _to_size-size){
16659 auto aret=_to->do_pop_back(size,_to);
16661 null_equivalent_check();
16666 return base_t::do_pop_back(size,self);
16669 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
16670 auto result=hash(nothing);
16671 const auto size=get_size();
16672 const auto size_before_erase_pos=_erase_pos;
16673 const auto size_after_erase_pos=size-size_before_erase_pos;
16674 result=_to->get_others_hash_with_calculated_before(result,0,_to,0,size_before_erase_pos);
16675 result=_to->get_others_hash_with_calculated_before(result,size_before_erase_pos,_to,_erase_pos+_erase_size,size_after_erase_pos);
16678 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
16679 if(pos+size<_erase_pos)
16680 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size);
16681 elseif(pos>_erase_pos)
16682 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos+_erase_size,size);
16684 const auto size_before_erase_pos=_erase_pos-pos;
16685 const auto size_after_erase_pos=size-size_before_erase_pos;
16686 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size_before_erase_pos);
16687 before=_to->get_others_hash_with_calculated_before(before,before_size+size_before_erase_pos,_to,_erase_pos+_erase_size,size_after_erase_pos);
16692 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
16693 auto wp = down_cast<this_t*>(with.get());
16694 return _erase_pos == wp->_erase_pos && _erase_size == wp->_erase_size;
16696 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t begin)
noexcept override final{
16697 if(begin < _erase_pos){
16698 auto aret=_to->get_the_largest_complete_data_block_begin_form(begin);
16699 if(aret.size() > _erase_pos){
16700 aret = {aret.begin(),_erase_pos};
16705 return _to->get_the_largest_complete_data_block_begin_form(begin + _erase_size);
16707 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
16708 auto wp=down_cast<this_t*>(with.get());
16709 if(!_to->equal_with(wp->_to,0,_erase_pos))
16711 return _to->equal_with(wp->_to,_erase_pos+_erase_size,_to_size);
16713 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
16714 auto wp=down_cast<this_t*>(with.get());
16715 if(
auto tmp=_to->compare_with(wp->_to,0,_erase_pos); tmp!=0)
16717 return _to->compare_with(wp->_to,_erase_pos+_erase_size,_to_size);
16719 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
16720 return float_size_of(*
this)+_to->get_memory_cost();
16723 template<
typename char_T>
16725 if(size==get_size())
16728 return get<erased_string_data_t<char_T>>(
this,pos,size);
16733 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
16734 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/inserted_string_data_t.hpp"
16743 template<
typename char_T>
16747 using base_t::ptr_t;
16748 using base_t::string_view_t;
16749 using base_t::self_changed;
16751 using base_t::copy_assign_nothrow;
16752 using base_t::copy_construct_nothrow;
16753 using base_t::move_construct_nothrow;
16754 using base_t::construct_nothrow;
16755 using base_t::destruct_nothrow;
16756 using base_t::clear_nothrow;
16757 using base_t::ptr_reset_nothrow;
16758 using base_t::hash_nothrow;
16759 using base_t::get_data_nothrow;
16760 using base_t::apply_data_nothrow;
16761 using base_t::set_hash_cache;
16764 ptr_t _insert_data;
16766 size_t _insert_pos;
16767 size_t _insert_size;
16769 inserted_string_data_t(ptr_t to,ptr_t insert_data,
size_t insert_pos)
noexcept:_to(to),_insert_data(insert_data),_insert_pos(insert_pos),_to_size(to->get_size()),_insert_size(insert_data->get_size()){}
16771 [[nodiscard]]
virtual ptr_t get_substr_data(
size_t begin,
size_t size)
noexcept override final{
16772 if(begin+size<_insert_pos)
16773 return _to->get_substr_data(begin,size);
16774 elseif(begin>_insert_pos+_insert_size)
16775 return _to->get_substr_data(begin-_insert_size,size);
16776 elseif(begin>=_insert_pos && begin+size<=_insert_pos+_insert_size)
16777 return _insert_data->get_substr_data(begin-_insert_pos,size);
16779 return base_t::get_substr_data(begin,size);
16781 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
16782 if(type_info<this_t> ==
typeid(*a)){
16783 const auto p = down_cast<this_t*>(a.get());
16784 if(_insert_pos==p->_insert_pos && _insert_size==p->_insert_size){
16786 base_t::equivalent_optimization(_to, p->_to);
16787 if(_insert_data!=p->_insert_data)
16788 base_t::equivalent_optimization(_insert_data, p->_insert_data);
16792 _insert_data.reset();
16793 base_t::be_replace_as(a);
16795 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _to_size+_insert_size; }
16797 virtual void copy_part_data_to(char_T* to,
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{
16798 if(pos+size<_insert_pos)
16799 _to->copy_part_data_to(to,pos,size);
16800 elseif(pos>_insert_pos+_insert_size)
16801 _to->copy_part_data_to(to,pos-_insert_size,size);
16803 if(_insert_pos>pos){
16804 auto size_before_insert_pos=_insert_pos-pos;
16805 _to->copy_part_data_to(to,pos,size_before_insert_pos);
16806 to+=size_before_insert_pos;
16807 size-=size_before_insert_pos;
16809 auto size_before_insert_end=min(size,_insert_size);
16810 _insert_data->copy_part_data_to(to,0,size_before_insert_end);
16811 to+=size_before_insert_end;
16812 size-=size_before_insert_end;
16814 _to->copy_part_data_to(to,_insert_pos,size);
16818 [[nodiscard]]
virtual ptr_t do_insert(
size_t pos,string_view_t str)
noexcept(copy_construct_nothrow)
override final{
16819 if(this->is_unique()){
16820 if(pos>=_insert_pos && pos<=_insert_pos+_insert_size){
16821 _insert_data=_insert_data->do_insert(pos-_insert_pos,str);
16822 _insert_size+=str.size();
16826 elseif(pos<_insert_pos){
16827 _to=_to->do_insert(pos,str);
16828 _to_size+=str.size();
16829 _insert_pos+=str.size();
16833 elseif(pos>_insert_pos+_insert_size){
16834 _to=_to->do_insert(pos-_insert_size,str);
16835 _to_size+=str.size();
16840 return base_t::do_insert(pos,str);
16842 [[nodiscard]]
virtual ptr_t do_erase(
size_t pos,
size_t size)
noexcept override final{
16843 if(this->is_unique()){
16844 if(pos>=_insert_pos && pos+size<=_insert_pos+_insert_size){
16845 _insert_data=_insert_data->do_erase(pos-_insert_pos,size);
16846 _insert_size-=size;
16850 elseif(pos+size<_insert_pos){
16851 _to=_to->do_erase(pos,size);
16857 elseif(pos>_insert_pos+_insert_size){
16858 _to=_to->do_erase(pos-_insert_size,size);
16864 return base_t::do_erase(pos,size);
16866 [[nodiscard]]
virtual char_T arec(
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
16867 if(index>=_insert_pos && index<_insert_pos+_insert_size)
16868 return _insert_data->arec(index-_insert_pos);
16869 elseif(index>=_insert_pos+_insert_size)
16870 return _to->arec(index-_insert_size);
16872 return _to->arec(index);
16875 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
16876 if(this->is_unique()){
16877 if(index>=_insert_pos && index<_insert_pos+_insert_size)
16878 _insert_data->arec_set(index-_insert_pos,a,p);
16879 elseif(index>=_insert_pos+_insert_size)
16880 _to->arec_set(index-_insert_size,a,p);
16882 _to->arec_set(index,a,p);
16886 base_t::arec_set(index,a,p);
16888 [[nodiscard]]
virtual ptr_t apply_str_to_begin(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16889 if(this->is_unique()){
16890 const auto size=str.size();
16891 if(_insert_pos==0){
16892 _insert_data=_insert_data->apply_str_to_begin(str);
16893 _insert_size+=size;
16896 _to=_to->apply_str_to_begin(str);
16897 _to_size+=str.size();
16904 return base_t::apply_str_to_begin(str);
16906 [[nodiscard]]
virtual ptr_t apply_str_to_begin(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16907 if(this->is_unique()){
16908 const auto size=str->get_size();
16909 if(_insert_pos==0){
16910 _insert_data=_insert_data->apply_str_to_begin(str);
16911 _insert_size+=size;
16914 _to=_to->apply_str_to_begin(str);
16915 _to_size+=str->get_size();
16922 return base_t::apply_str_to_begin(str);
16924 [[nodiscard]]
virtual ptr_t apply_str_to_end(string_view_t str)
noexcept(copy_construct_nothrow&&apply_data_nothrow)
override final{
16925 if(this->is_unique()){
16926 if(_insert_pos==_to_size){
16927 _insert_data=_insert_data->apply_str_to_end(str);
16928 _insert_size+=str.size();
16931 _to=_to->apply_str_to_end(str);
16932 _to_size+=str.size();
16938 return base_t::apply_str_to_end(str);
16940 [[nodiscard]]
virtual ptr_t apply_str_to_end(ptr_t str)
noexcept(apply_data_nothrow)
override final{
16941 if(this->is_unique()){
16942 if(_insert_pos==_to_size){
16943 _insert_data=_insert_data->apply_str_to_end(str);
16944 _insert_size+=str->get_size();
16947 _to=_to->apply_str_to_end(str);
16948 _to_size+=str->get_size();
16954 return base_t::apply_str_to_end(str);
16956 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16957 if(this->is_unique()){
16958 if(_insert_pos > size){
16959 auto aret=_to->do_pop_front(size,_to);
16965 elseif(_insert_pos==0 && _insert_size>=size){
16966 auto aret=_insert_data->do_pop_front(size,_insert_data);
16967 _insert_size-=size;
16972 return base_t::do_pop_front(size,self);
16974 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t& self)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
16975 if(this->is_unique()){
16976 if(_insert_pos+_insert_size <= _to_size-size){
16977 auto aret=_to->do_pop_back(size,_to);
16982 elseif(_insert_pos==_to_size && _insert_size>=size){
16983 auto aret=_insert_data->do_pop_front(size,_insert_data);
16984 _insert_size-=size;
16989 return base_t::do_pop_back(size,self);
16992 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
16993 auto result=hash(nothing);
16995 result=_to->get_others_hash_with_calculated_before(result,0,_to,0,_insert_pos);
16997 result=hash.merge_array_hash_results(result,_insert_pos,_insert_data->get_hash(_insert_data),_insert_size);
16998 const auto size=_to_size-_insert_pos;
17000 result=_to->get_others_hash_with_calculated_before(result,_insert_pos+_insert_size,_to,_insert_pos,size);
17003 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
17004 if(pos+size<_insert_pos)
17005 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size);
17006 elseif(pos>_insert_pos+_insert_size)
17007 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos-_insert_size,size);
17009 if(_insert_pos>pos){
17010 const auto size_before_insert_pos=_insert_pos-pos;
17011 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,pos,size_before_insert_pos);
17012 size-=size_before_insert_pos;
17013 before_size+=size_before_insert_pos;
17015 auto size_before_insert_end=min(size,_insert_size);
17016 before=_insert_data->get_others_hash_with_calculated_before(before,before_size,_insert_data,0,size_before_insert_end);
17017 size-=size_before_insert_end;
17018 before_size+=size_before_insert_end;
17020 before=_to->get_others_hash_with_calculated_before(before,before_size,_to,_insert_pos,size);
17025 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
17026 auto wp=down_cast<this_t*>(with.get());
17027 return _insert_pos==wp->_insert_pos && _insert_size==wp->_insert_size;
17029 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form(
size_t index)
noexcept override final{
17030 if(index>=_insert_pos && index<_insert_pos+_insert_size)
17031 return _insert_data->get_the_largest_complete_data_block_begin_form(index-_insert_pos);
17032 elseif(index>=_insert_pos+_insert_size)
17033 return _to->get_the_largest_complete_data_block_begin_form(index-_insert_size);
17035 auto aret=_to->get_the_largest_complete_data_block_begin_form(index);
17036 if(aret.size()+index > _insert_pos)
17037 aret = {aret.begin(), note::size(_insert_pos-index)};
17041 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
17042 auto wp=down_cast<this_t*>(with.get());
17043 if(!_insert_data->equal_with(wp->_insert_data))
17045 return _to->equal_with(wp->_to);
17047 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
17048 auto wp=down_cast<this_t*>(with.get());
17049 if(
auto tmp=_to->compare_with(wp->_to,0,_insert_pos); tmp!=0)
17051 if(
auto tmp=_insert_data->compare_with(wp->_insert_data); tmp!=0)
17053 return _to->compare_with(wp->_to,_insert_pos,_to_size-(_insert_pos+_insert_size));
17055 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
17056 return float_size_of(*
this)+_insert_data->get_memory_cost()+_to->get_memory_cost();
17059 template<
typename char_T>
17061 return get<inserted_string_data_t<char_T>>(
this,str,pos);
17063 template<
typename char_T>
17064 base_string_data_t<char_T>::ptr_t base_string_data_t<char_T>::do_insert(
size_t pos,
string_view_t str)
noexcept(copy_construct_nothrow){
17066 return this->apply_str_to_begin(str);
17067 elseif(pos==get_size())
17068 return this->apply_str_to_end(str);
17070 return this->do_insert(pos,get<comn_string_data_t<char_T>>(str));
17075 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
17079 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/same_value_compress_string_data_t.hpp"
17088 template<
typename char_T>
17092 using base_t::ptr_t;
17093 using base_t::string_view_t;
17094 using base_t::self_changed;
17096 using base_t::copy_assign_nothrow;
17097 using base_t::copy_construct_nothrow;
17098 using base_t::move_construct_nothrow;
17099 using base_t::construct_nothrow;
17100 using base_t::destruct_nothrow;
17101 using base_t::clear_nothrow;
17102 using base_t::ptr_reset_nothrow;
17103 using base_t::hash_nothrow;
17104 using base_t::get_data_nothrow;
17105 using base_t::apply_data_nothrow;
17106 using base_t::set_hash_cache;
17113 virtual void be_replace_as(ptr_t a)
noexcept(clear_nothrow)
override final{
17114 base_t::be_replace_as(a);
17116 [[nodiscard]]
virtual ptr_t get_substr_data([[maybe_unused]]
size_t begin,
size_t size)
noexcept override final{
17117 return get<same_value_compress_string_data_t<char_T>>(size,_value);
17119 [[nodiscard]]
virtual size_t get_size()
noexcept override final{
return _size; }
17121 virtual void copy_part_data_to(char_T* to,[[maybe_unused]]
size_t pos,
size_t size)
noexcept(copy_assign_nothrow)
override final{
17122 copy_assign[size](_value,note::to(to));
17125 [[nodiscard]]
virtual char_T arec([[maybe_unused]]
size_t index)
noexcept(copy_construct_nothrow&&move_construct_nothrow)
override final{
17128 virtual void arec_set(
size_t index,char_T a,ptr_t& p)
noexcept(copy_assign_nothrow&&move_construct_nothrow)
override final{
17129 base_t::arec_set(index,a,p);
17131 [[nodiscard]]
virtual ptr_t do_pop_front(
size_t size,ptr_t&)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
17132 if(this->is_unique()){
17138 return get<same_value_compress_string_data_t<char_T>>(_size-size,_value);
17140 [[nodiscard]]
virtual ptr_t do_pop_back(
size_t size,ptr_t&)
noexcept(construct_nothrow&©_assign_nothrow)
override final{
17141 if(this->is_unique()){
17147 return get<same_value_compress_string_data_t<char_T>>(_size-size,_value);
17150 virtual hash_t get_hash_detail(ptr_t&)
noexcept(hash_nothrow)
override final{
17151 return hash.repeat_times(_value,_size);
17153 virtual hash_t get_others_hash_with_calculated_before_detail(
hash_t before,
size_t before_size,ptr_t&,[[maybe_unused]]
size_t pos,
size_t size)
noexcept(hash_nothrow)
override final{
17154 return hash.merge_array_hash_results(before,before_size,hash.repeat_times(_value,size),size);
17157 [[nodiscard]]
virtual bool same_struct(ptr_t with)
noexcept override final{
17160 [[nodiscard]]
virtual range_t<const char_T*> get_the_largest_complete_data_block_begin_form([[maybe_unused]]
size_t begin)
noexcept override final{
17161 if constexpr(construct<char_T>.trivial<
const char_T&> && destruct.trivial<char_T>){
17162 constexpr size_t data_size=512;
17163 static char_T data[data_size];
17164 if(data[0]!=_value)
17165 copy_assign[data_size](_value,note::to(data));
17166 return {data,note::size(min(_size-begin,data_size))};
17169 return {&_value,note::size<size_t>(1)};
17171 [[nodiscard]]
virtual bool same_struct_equal(ptr_t with)
noexcept(equal.nothrow<char_T>)
override final{
17172 auto wp=down_cast<this_t*>(with.get());
17173 return equal(_value,wp->_value);
17175 [[nodiscard]]
virtual base_t::compare_type same_struct_compare(ptr_t with)
noexcept(compare.nothrow<char_T>)
override final{
17176 auto wp=down_cast<this_t*>(with.get());
17177 return compare(_value,wp->_value);
17179 [[nodiscard]]
virtual float_size_t get_base_memory_cost()
noexcept override final{
17180 return float_size_of(*
this);
17186 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/string_data_t/_body.hpp"
17191 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/defs.hpp"
17192 template<
typename char_T>
17194 static_assert(type_info<char_T> != type_info<const char_T>);
17197 typedef base_t_w::ptr_t ptr_t;
17198 typedef base_t_w::string_view_t string_view_t;
17199 typedef const constexpr_str_t<char_T> constexpr_str_t;
17201 typedef char_T value_type;
17202 typedef value_type char_type;
17203 typedef size_t size_type;
17204 static constexpr size_t npos = range_n::npos;
17208 mutable union _cso_info_t{
17210 const constexpr_str_t* _str;
17213 push_and_disable_msvc_warning(26495);
17214 constexpr _cso_info_t()
noexcept{}
17215 constexpr _cso_info_t(
const _cso_info_t&a)
noexcept{
17216 copy_assign[
sizeof(_cso_info_t)](cast_to_data(
this),cast_to_data(&a));
17218 pop_msvc_warning();
17219 constexpr void operator=(
const _cso_info_t&a)
noexcept{
17220 copy_assign[
sizeof(_cso_info_t)](cast_to_data(
this),cast_to_data(&a));
17222 ~_cso_info_t()
noexcept{}
17225 mutable struct _cso_flags_t{
17227 bool _str_cso_flag=0;
17231 #define _m _cso_info._mptr
17236 constexpr void _ncso_destruct_mptr()
const noexcept{destruct(&_m);}
17238 constexpr void _ncso_construct_mptr()
const noexcept{construct<ptr_t>[&_m]();}
17240 constexpr void _ncso_construct_mptr(ptr_t p)
const noexcept{construct<ptr_t>[&_m](p);}
17245 [[nodiscard]]
bool _in_cso()
const noexcept{
return _cso_flags._cso_flag;}
17246 [[nodiscard]]
bool _in_str_cso()
const noexcept{
return _in_cso() && _cso_flags._str_cso_flag;}
17247 [[nodiscard]]
bool _in_chr_cso()
const noexcept{
return _in_cso() && !_cso_flags._str_cso_flag;}
17250 constexpr void _set_str_cso()
const noexcept{_cso_flags._cso_flag=1;_cso_flags._str_cso_flag=1;}
17251 constexpr void _set_chr_cso()
const noexcept{_cso_flags._cso_flag=1;_cso_flags._str_cso_flag=0;}
17252 constexpr void _set_not_cso()
const noexcept{_cso_flags._cso_flag=0;}
17256 [[nodiscard]]
const char_T* _get_cso_data()
const noexcept{
return _in_str_cso()?_cso_info._str->str():&_cso_info._ch;}
17257 [[nodiscard]]
size_t _get_cso_size()
const noexcept{
return _in_str_cso()?_cso_info._str->size():1;}
17258 [[nodiscard]]
hash_t _get_cso_hash()
const noexcept{
return _in_str_cso()?hash(_get_cso_constexpr_str()):hash(_cso_info._ch);}
17259 [[nodiscard]]constexpr_str_t& _get_cso_constexpr_str()
const noexcept{
return *_cso_info._str;}
17263 constexpr void _cso_init(constexpr_str_t&str)
noexcept{_set_str_cso();_cso_info._str=&str;}
17264 constexpr void _cso_reinit(constexpr_str_t&str)
noexcept{
if(!_in_cso())_ncso_destruct_mptr();_cso_init(str);}
17265 constexpr void _cso_init(char_T ch)
noexcept{_set_chr_cso();_cso_info._ch=ch;}
17266 constexpr void _cso_reinit(char_T ch)
noexcept{
if(!_in_cso())_ncso_destruct_mptr();_cso_init(ch);}
17267 void _cso_fin(
bool need_write)
const noexcept{
17268 if(_in_str_cso()&&!need_write)
17271 auto str=string_view_t{_get_cso_data(),_get_cso_size()};
17276 void _cso_fin(ptr_t p)
noexcept{
17278 _ncso_construct_mptr(p);
17283 static constexpr bool the_size_worth_to_end_cso(
size_t size)
noexcept{
17285 return size>=max_size;
17287 static void full_copy_cso_check(
const string_t&str)
noexcept{
17288 if(the_size_worth_to_end_cso(str.size()))
17294 void _cso_check(
bool need_write=0)
const noexcept{
17296 _cso_fin(need_write);
17300 string_t(ptr_t str)
noexcept{_ncso_construct_mptr(str);}
17302 [[nodiscard]]ptr_t ptr_copy()
const noexcept{
17308 void swap_with(
this_t& a)
noexcept{
17309 if(_in_cso()||a._in_cso()){
17310 swap(_cso_info,a._cso_info);
17311 swap(_cso_flags,a._cso_flags);
17319 constexpr string_t(constexpr_str_t&str)
noexcept{_cso_init(str);}
17322 constexpr string_t(char_T ch)
noexcept{_cso_init(ch);}
17325 _cso_info=str._cso_info;
17326 _cso_flags=str._cso_flags;
17329 _ncso_construct_mptr(str._m);
17335 string_t(char_T ch,
size_t size)
noexcept requires(type_info<size_t>!=type_info<char_T>):
string_t(size,ch){}
17340 ~string_t()
noexcept{
if(!_in_cso())_ncso_destruct_mptr();}
17343 string_t& operator=(
const string_t& str)
noexcept{re_construct[
this](str);
return*
this;}
17345 constexpr string_t& operator=(constexpr_str_t&str)
noexcept{_cso_reinit(str);
return*
this;}
17346 constexpr string_t& operator=(char_T ch)
noexcept{_cso_reinit(ch);
return*
this;}
17351 full_copy_cso_check(str);
17353 return operator+(str.to_string_view_t());
17355 return ptr_copy()->apply_str_to_end(str._m);
17357 [[nodiscard]]
string_t operator+(string_view_t str)
const noexcept{
17358 return ptr_copy()->apply_str_to_end(str);
17360 [[nodiscard]]
string_t operator+(
const char_T* str)
const noexcept{
17361 return *
this+string_view_t(str);
17363 friend [[nodiscard]]
string_t operator+(string_view_t str1,
const string_t& str2)
noexcept{
17364 return str2.ptr_copy()->apply_str_to_begin(str1);
17366 friend [[nodiscard]]
string_t operator+(
const char_T* str1,
const string_t& str2)
noexcept{
17367 return string_view_t(str1)+str2;
17369 friend [[nodiscard]]
string_t operator+(char_T ch,
const string_t& str)
noexcept{
17370 return string_view_t{&ch,1}+str;
17377 string_t& operator+=(string_view_t str)&
noexcept{
17381 string_t& operator+=(
const char_T* str)&
noexcept{
17382 return *
this+=string_view_t(str);
17384 string_t& operator+=(char_T ch)&
noexcept{
17385 return *
this += string_view_t{&ch,1};
17387 template<
typename U>
17388 [[nodiscard]]
string_t&& operator+(U&& b)&&noexcept_as(*
this+=b)
requires was_not_an_ill_form(*
this+=b){
17390 return move(*
this);
17395 float_size_t memory_cost()
const noexcept{
17399 return _m->get_memory_cost();
17403 [[nodiscard]]
constexpr auto operator<=>(
const string_t& a)
const noexcept(compare.nothrow<char_T>){
17404 if(a._in_str_cso())
17405 return operator<=>(a._get_cso_constexpr_str());
17406 elseif(a._in_cso())
17407 return operator<=>(a.to_string_view_t());
17408 auto ssize = size();
17409 auto scom = compare(ssize,a.size());
17412 return _m->compare_with(a._m);
17413 elseif(_in_str_cso())
17414 return compare.reverse(a<=>_get_cso_constexpr_str());
17416 return compare.reverse(a<=>to_string_view_t());
17420 [[nodiscard]]
constexpr auto operator==(
const string_t& a)
const noexcept(equal.nothrow<char_T>){
17421 if(a._in_str_cso())
17422 return operator==(a._get_cso_constexpr_str());
17423 elseif(a._in_cso())
17424 return operator==(a.to_string_view_t());
17425 auto ssize = size();
17426 const auto seq = equal(ssize,a.size());
17429 return _m->equal_with(a._m);
17430 elseif(_in_str_cso())
17431 return a==_get_cso_constexpr_str();
17433 return a==to_string_view_t();
17437 [[nodiscard]]
constexpr auto operator<=>(string_view_t a)
const noexcept(compare.nothrow<char_T>){
17438 auto ssize = size();
17439 auto scom = compare(ssize,a.size());
17442 return compare(data(),a.begin(),ssize);
17444 return _m->compare_with(a);
17448 [[nodiscard]]
constexpr auto operator==(string_view_t a)
const noexcept(equal.nothrow<char_T>){
17449 auto ssize = size();
17450 const auto seq = equal(ssize,a.size());
17453 return equal(data(),a.begin(),ssize);
17455 return _m->equal_with(a);
17459 [[nodiscard]]
constexpr auto operator<=>(constexpr_str_t&a)
const noexcept(compare.nothrow<char_T>){
17460 if(_in_cso() && data()==a.str())
17461 return strong_ordering::equivalent;
17462 auto tmp=operator<=>((string_view_t&)a);
17464 remove_const(
this)->_cso_reinit(a);
17467 [[nodiscard]]
constexpr auto operator==(constexpr_str_t&a)
const noexcept(equal.nothrow<char_T>){
17468 if(_in_cso() && data()==a.str())
17470 const auto tmp=operator==((string_view_t&)a);
17472 remove_const(
this)->_cso_reinit(a);
17475 [[nodiscard]]
constexpr auto operator<=>(
const char_T* a)
const noexcept(compare.nothrow<char_T>){
17477 return compare(data(),size(),a,end_by_zero);
17479 return _m->compare_with(a);
17481 [[nodiscard]]
constexpr auto operator==(
const char_T* a)
const noexcept(equal.nothrow<char_T>){
17483 return equal(data(),size(),a,end_by_zero);
17485 return _m->equal_with(a);
17489 [[nodiscard]]char_T* unique_c_str()
noexcept{ _cso_check(1);
return _m->get_unique_c_str(_m); }
17491 [[nodiscard]]char_T arec(
size_t index)
noexcept{
17493 return _get_cso_data()[index];
17495 return _m->arec(index);
17497 void arec_set(
size_t index,char_T a)
noexcept{ _cso_check(1);
return _m->arec_set(index,a,_m); }
17505 arec_t(
string_t* to,
size_t index)
noexcept:_to(to),_index(index){}
17507 [[nodiscard]]
operator char_T()
const&&
noexcept{
return _to->arec(_index); }
17508 arec_t&& operator=(char_T a)&&
noexcept{
17509 _to->arec_set(_index,a);
17510 return move(*
this);
17512 arec_t&& operator=(
const arec_t&&ch)&&
noexcept{
return move(*this).operator=(move(ch).
operator char_T()); }
17514 [[nodiscard]]char_T* get_address()
noexcept{
return _to->unique_c_str()+_index; }
17515 [[nodiscard]]
const char_T* get_address()
const noexcept{
return (add_const(_to))->c_str()+_index; }
17517 [[nodiscard]]char_T* operator&()&&
noexcept{
return get_address(); }
17518 [[nodiscard]]
const char_T* operator&()
const&&
noexcept{
return get_address(); }
17525 [[nodiscard]]
arec_t operator[](
size_t index)
noexcept{
return{
this,index}; }
17526 [[nodiscard]]
const arec_t operator[](
size_t index)
const noexcept{
return{remove_const(
this),index}; }
17529 [[nodiscard]]arec_t front()noexcept{
return{
this,0}; }
17530 [[nodiscard]]
const arec_t front()const noexcept{
return{remove_const(
this),0}; }
17532 [[nodiscard]]arec_t back()noexcept{
return{
this,size()-1}; }
17533 [[nodiscard]]
const arec_t back()const noexcept{
return{remove_const(
this),size()-1}; }
17536 [[nodiscard]]string_t operator+(
const arec_t&& ch)
const noexcept{
17537 return *
this+move(ch).operator char_T();
17539 string_t& operator+=(
const arec_t&& ch)&
noexcept{
17540 return *
this+=move(ch).operator char_T();
17545 static constexpr bool floating_arec_result_able=was_not_an_ill_form(
17546 magic_number::linear_interpolation::get_result(declvalue(
size_t),
17547 magic_number::linear_interpolation::get_k(declvalue(char_T),declvalue(char_T)),
17548 declvalue(float_t))
17550 static auto floating_arec_result_type_helper()noexcept{
17551 if constexpr(floating_arec_result_able)
17552 return magic_number::linear_interpolation::get_result(
size_t{},
17553 magic_number::linear_interpolation::get_k(char_T{},char_T{}),
17556 typedef decltype(floating_arec_result_type_helper()) floating_arec_result_type;
17557 static constexpr bool floating_arec_set_able=was_not_an_ill_form(
17558 magic_number::linear_interpolation::get_reverse_result(
17559 magic_number::linear_interpolation::get_k(declvalue(char_T),declvalue(char_T)),
17560 declvalue(float_t),declvalue(char_T))
17563 static constexpr bool floating_arec_able=floating_arec_result_able||floating_arec_set_able;
17572 static constexpr bool result_able=floating_arec_result_able;
17573 static constexpr bool set_able=floating_arec_set_able;
17576 _index_x1=
static_cast<size_t>(index);
17577 _index_x2=_index_x1+1;
17580 [[nodiscard]]
operator floating_arec_result_type()
const&&
noexcept requires result_able{
17581 char_T y1=_to->arec(_index_x1);
17582 char_T y2=_to->arec(_index_x2);
17583 auto δx=_index-_index_x1;
17584 return magic_number::linear_interpolation::get_result(y1,
17585 magic_number::linear_interpolation::get_k(y1,y2),
17588 floating_arec_t&& operator=(floating_arec_result_type a)&&
noexcept requires set_able{
17589 char_T y1=_to->arec(_index_x1);
17590 char_T y2=_to->arec(_index_x2);
17591 auto k=magic_number::linear_interpolation::get_k(y1,y2);
17592 auto δx1=_index-_index_x1;
17593 auto δx2=_index-_index_x2;
17594 y1=(char_T)magic_number::linear_interpolation::get_reverse_result(k,δx1,a);
17595 y2=(char_T)magic_number::linear_interpolation::get_reverse_result(k,δx2,a);
17596 _to->arec_set(_index_x1,y1);
17597 _to->arec_set(_index_x2,y2);
17598 return move(*
this);
17601 [[nodiscard]]
floating_arec_t operator[](float_t index)
noexcept requires(floating_arec_able){
return{
this,index}; }
17602 [[nodiscard]]
const floating_arec_t operator[](float_t index)
const noexcept requires(floating_arec_able){
return{remove_const(
this),index}; }
17605 template<
typename T> requires ::std::is_arithmetic_v<T>
17606 [[nodiscard]]
auto operator[](T index)
noexcept{
17607 if constexpr(::std::is_floating_point_v<T>)
17608 return operator[](
static_cast<float_t
>(index));
17610 return operator[](
static_cast<size_t>(index));
17612 template<
typename T> requires ::std::is_arithmetic_v<T>
17613 [[nodiscard]]
const auto operator[](T index)
const noexcept{
17614 if constexpr(::std::is_floating_point_v<T>)
17615 return operator[](
static_cast<float_t
>(index));
17617 return operator[](
static_cast<size_t>(index));
17620 [[nodiscard]]string_t substr(
size_t begin,
size_t size=npos)
const noexcept{
17621 size=min(size,this->size()-begin);
17624 return _m->get_substr_data(begin,size);
17629 [[nodiscard]]
const char_T* data()const noexcept{
if(_in_cso())
return _get_cso_data();
else return _m->get_data(_m); }
17630 [[nodiscard]]char_T* writeable_data()noexcept{
return unique_c_str(); }
17631 [[nodiscard]]
const char_T* c_str()const noexcept{
if(_in_cso())
return _get_cso_data();
else return _m->get_const_c_str(_m); }
17632 [[nodiscard]]char_T* writeable_c_str()noexcept{
return unique_c_str(); }
17633 [[nodiscard]]
size_t size()const noexcept{
if(_in_cso())
return _get_cso_size();
else return _m->get_size(); }
17634 [[nodiscard]]
explicit operator bool()const noexcept{
return size(); }
17635 [[nodiscard]]
bool empty()const noexcept{
return !size(); }
17636 [[nodiscard]]
size_t length()const noexcept{
return size(); }
17637 void resize(
size_t nsize,char_T ch)
noexcept{
17638 const auto size=this->size();
17640 *
this=substr(0,nsize);
17641 elseif(size == nsize)
17645 _m=get<end_apply_string_data_t<char_T>>(_m,nsize-size,ch);
17648 *
this=string_t{nsize,ch};
17650 void resize(
size_t nsize)
noexcept{
17651 const auto size=this->size();
17653 *
this=substr(0,nsize);
17654 elseif(size == nsize)
17658 _m=get<end_apply_string_data_t<char_T>>(_m,nsize-size);
17661 *
this=string_t{nsize};
17663 void clear()noexcept{ re_construct(
this); }
17665 struct iterator_base_t{
17669 [[nodiscard]]
constexpr iterator_base_t get_before()const noexcept{
return{_to,_index-1}; }
17670 [[nodiscard]]
constexpr iterator_base_t get_next()const noexcept{
return{_to,_index+1}; }
17671 [[nodiscard]]arec_t get_value()noexcept{
return (*_to)[_index]; }
17672 [[nodiscard]]
const arec_t get_value()const noexcept{
return (*add_const(_to))[_index]; }
17673 [[nodiscard]]char_T* get_handle()noexcept{
return &get_value(); }
17674 [[nodiscard]]
const char_T* get_handle()const noexcept{
return &get_value(); }
17675 [[nodiscard]]
constexpr bool operator==(
const iterator_base_t& a)
const noexcept{
return _to==a._to && _index==a._index; }
17676 [[nodiscard]]
constexpr auto operator<=>(
const iterator_base_t& a)
const noexcept{
return _to==a._to ? _index<=>a._index : partial_ordering::unordered; }
17678 [[nodiscard]]iterator_base_t get_iterator_data_at(ptrdiff_t index)
const noexcept{
return iterator_base_t{(string_t*)
this,index}; }
17680 typedef iterator_t<char_T,iterator_base_t> iterator;
17681 typedef const_iterator_t<char_T,const iterator_base_t> const_iterator;
17683 [[nodiscard]]iterator get_iterator_at(ptrdiff_t index)
noexcept{
return get_iterator_data_at(index); }
17684 [[nodiscard]]const_iterator get_iterator_at(ptrdiff_t index)
const noexcept{
return get_iterator_data_at(index); }
17685 [[nodiscard]]iterator begin()noexcept{
return get_iterator_at(0); }
17686 [[nodiscard]]const_iterator begin()const noexcept{
return get_iterator_at(0); }
17687 [[nodiscard]]const_iterator cbegin()const noexcept{
return begin(); }
17688 [[nodiscard]]iterator end()noexcept{
return get_iterator_at(size()); }
17689 [[nodiscard]]const_iterator end()const noexcept{
return get_iterator_at(size()); }
17690 [[nodiscard]]const_iterator cend()const noexcept{
return end(); }
17692 typedef reverse_iterator_t<char_T,iterator_base_t> reverse_iterator;
17693 typedef reverse_const_iterator_t<char_T,const iterator_base_t> reverse_const_iterator;
17695 [[nodiscard]]reverse_iterator get_reverse_iterator_at(ptrdiff_t index)
noexcept{
return get_iterator_data_at(index); }
17696 [[nodiscard]]reverse_const_iterator get_reverse_iterator_at(ptrdiff_t index)
const noexcept{
return get_iterator_data_at(index); }
17697 [[nodiscard]]reverse_iterator rbegin()noexcept{
return get_reverse_iterator_at(size()-1); }
17698 [[nodiscard]]reverse_const_iterator rbegin()const noexcept{
return get_reverse_iterator_at(size()-1); }
17699 [[nodiscard]]reverse_const_iterator rcbegin()const noexcept{
return rbegin(); }
17700 [[nodiscard]]reverse_iterator rend()noexcept{
return get_reverse_iterator_at(-1); }
17701 [[nodiscard]]reverse_const_iterator rend()const noexcept{
return get_reverse_iterator_at(-1); }
17702 [[nodiscard]]reverse_const_iterator rcend()const noexcept{
return rend(); }
17706 void push_back(
const string_t& str)&
noexcept{
17707 full_copy_cso_check(*
this);
17708 full_copy_cso_check(str);
17709 if(_in_cso()&&!str._in_cso())
17710 _cso_fin(str._m->apply_str_to_begin(to_string_view_t()));
17711 elseif(str._in_cso()){
17712 push_back(str.to_string_view_t());
17716 _m=_m->apply_str_to_end(str._m);
17719 void push_back(string_view_t str)&
noexcept{ _cso_check();_m=_m->apply_str_to_end(str); }
17720 void push_back(char_T ch)&
noexcept{ push_back(string_view_t{&ch,1}); }
17721 void push_back(
const arec_t&& ch)&
noexcept{ push_back(move(ch).
operator char_T()); }
17722 void push_back(
const char_T* str)&
noexcept{ push_back(string_view_t(str)); }
17724 void push_front(
const string_t& str)&
noexcept{
17725 full_copy_cso_check(*
this);
17726 full_copy_cso_check(str);
17727 if(_in_cso()&&!str._in_cso())
17728 _cso_fin(str._m->apply_str_to_end(to_string_view_t()));
17729 elseif(str._in_cso()){
17730 push_front(str.to_string_view_t());
17734 _m=_m->apply_str_to_begin(str._m);
17737 void push_front(string_view_t str)&
noexcept{ _cso_check();_m=_m->apply_str_to_begin(str); }
17738 void push_front(char_T ch)&
noexcept{ push_front(string_view_t{&ch,1}); }
17739 void push_front(
const arec_t&& ch)&
noexcept{ push_front(move(ch).
operator char_T()); }
17740 void push_front(
const char_T* str)&
noexcept{ push_front(string_view_t(str)); }
17742 string_t pop_back(
size_t size)
noexcept{ _cso_check();
return _m->do_pop_back(size,_m); }
17743 string_t pop_front(
size_t size)
noexcept{ _cso_check();
return _m->do_pop_front(size,_m); }
17744 char_T pop_back()noexcept{
return pop_back(1)[0]; }
17745 char_T pop_front()noexcept{
return pop_front(1)[0]; }
17749 [[nodiscard]]
operator string_view_t()const&noexcept{
return string_view_t{data(),size()}; }
17750 [[nodiscard]]
auto to_string_view_t()const&noexcept{
return operator string_view_t(); }
17751 [[nodiscard]]
auto view()&
noexcept{
return array_like_view_t<char_T>{writeable_data(),size()}; }
17752 [[nodiscard]]
auto view()const&noexcept{
return array_like_view_t<const char_T>{data(),size()}; }
17753 [[nodiscard]]
explicit operator hash_t()const noexcept{
return _in_cso()?_get_cso_hash():_m->get_hash(_m); }
17756 static constexpr bool find_nothrow=equal.nothrow<char_T>;
17757 [[nodiscard]]
size_t find(
const char_T ch,
size_t begin=0)const noexcept(find_nothrow){
17758 return in_range_size_t(ch, to_string_view_t().substr(begin));
17760 [[nodiscard]]
size_t reverse_find(
const char_T ch)
const noexcept(find_nothrow){
17761 return in_range_but_reverse_size_t(ch, to_string_view_t());
17763 [[nodiscard]]
size_t find(string_view_t str,
size_t begin=0)const noexcept(find_nothrow){
17764 return in_range_size_t(str, to_string_view_t().substr(begin));
17766 [[nodiscard]]
size_t reverse_find(string_view_t str)
const noexcept(find_nothrow){
17767 return in_range_but_reverse_size_t(str, to_string_view_t());
17769 [[nodiscard]]
size_t find(constexpr_str_t&str,
size_t begin=0)const noexcept(find_nothrow){
17770 return in_range_size_t(str, to_string_view_t().substr(begin));
17772 [[nodiscard]]
size_t reverse_find(constexpr_str_t&str)
const noexcept(find_nothrow){
17773 return in_range_but_reverse_size_t(str, to_string_view_t());
17775 [[nodiscard]]
size_t find(
const string_t&str,
size_t begin=0)const noexcept(find_nothrow){
17777 if(str._in_str_cso())
17778 return find(str._get_cso_constexpr_str(),begin);
17779 elseif(str._in_cso())
17780 return find(str._cso_info._ch,begin);
17782 auto result = str._m->get_match_pattern_from_self(str._m).match(to_string_view_t().substr(begin));
17784 return result - data();
17788 [[nodiscard]]
size_t reverse_find(const string_t&str)const noexcept(find_nothrow){
17790 if(str._in_str_cso())
17791 return reverse_find(str._get_cso_constexpr_str());
17792 elseif(str._in_cso())
17793 return reverse_find(str._cso_info._ch);
17795 auto result = str._m->get_reverse_match_pattern_from_self(str._m).match(to_string_view_t());
17797 return result - data();
17802 [[nodiscard]]
size_t find_first_of(string_view_t str)const noexcept(find_nothrow){
17803 return range_n::find_first_of_size_t(str,to_string_view_t());
17805 [[nodiscard]]
size_t find_first_of(constexpr_str_t&str)
const noexcept(find_nothrow){
17806 return range_n::find_first_of_size_t(str,to_string_view_t());
17808 [[nodiscard]]
size_t find_first_of(
const string_t&str)
const noexcept(find_nothrow){
17810 if(str._in_str_cso())
17811 return find_first_of(str._get_cso_constexpr_str());
17812 elseif(str._in_cso())
17813 return find(str._cso_info._ch);
17815 return find_first_of(str.to_string_view_t());
17817 [[nodiscard]]
size_t find_first_of(const char_T*str)const noexcept(find_nothrow){
17818 return find_first_of(string_view_t(str));
17820 [[nodiscard]]
size_t find_first_of(char_T ch)
const noexcept(find_nothrow){
17823 [[nodiscard]]
size_t find_first_of(
const arec_t&&ch)
const noexcept(find_nothrow){
17824 return find(move(ch).
operator char_T());
17826 [[nodiscard]]
size_t find_first_not_of(string_view_t str)
const noexcept(find_nothrow){
17827 return range_n::find_first_not_of_size_t(str,to_string_view_t());
17829 [[nodiscard]]
size_t find_first_not_of(constexpr_str_t&str)
const noexcept(find_nothrow){
17830 return range_n::find_first_not_of_size_t(str,to_string_view_t());
17832 [[nodiscard]]
size_t find_first_not_of(
const string_t&str)
const noexcept(find_nothrow){
17834 if(str._in_str_cso())
17835 return find_first_not_of(str._get_cso_constexpr_str());
17836 elseif(str._in_cso())
17837 return find_first_not_of(str.to_string_view_t());
17839 return find_first_not_of(str.to_string_view_t());
17841 [[nodiscard]]
size_t find_first_not_of(const char_T*str)const noexcept(find_nothrow){
17842 return find_first_not_of(string_view_t(str));
17844 [[nodiscard]]
size_t find_first_not_of(char_T ch)
const noexcept(find_nothrow){
17845 return find_first_not_of(string_view_t(ch));
17847 [[nodiscard]]
size_t find_first_not_of(
const arec_t&&ch)
const noexcept(find_nothrow){
17848 return find_first_not_of(string_view_t(move(ch).
operator char_T()));
17850 [[nodiscard]]
size_t find_last_of(string_view_t str)
const noexcept(find_nothrow){
17851 return range_n::find_last_of_size_t(str,to_string_view_t());
17853 [[nodiscard]]
size_t find_last_of(constexpr_str_t&str)
const noexcept(find_nothrow){
17854 return range_n::find_last_of_size_t(str,to_string_view_t());
17856 [[nodiscard]]
size_t find_last_of(
const string_t&str)
const noexcept(find_nothrow){
17858 if(str._in_str_cso())
17859 return find_last_of(str._get_cso_constexpr_str());
17860 elseif(str._in_cso())
17861 return reverse_find(str._cso_info._ch);
17863 return find_last_of(str.to_string_view_t());
17865 [[nodiscard]]
size_t find_last_of(const char_T*str)const noexcept(find_nothrow){
17866 return find_last_of(string_view_t(str));
17868 [[nodiscard]]
size_t find_last_of(char_T ch)
const noexcept(find_nothrow){
17869 return reverse_find(ch);
17871 [[nodiscard]]
size_t find_last_of(
const arec_t&&ch)
const noexcept(find_nothrow){
17872 return reverse_find(move(ch).
operator char_T());
17874 [[nodiscard]]
size_t find_last_not_of(string_view_t str)
const noexcept(find_nothrow){
17875 return range_n::find_last_not_of_size_t(str,to_string_view_t());
17877 [[nodiscard]]
size_t find_last_not_of(constexpr_str_t&str)
const noexcept(find_nothrow){
17878 return range_n::find_last_not_of_size_t(str,to_string_view_t());
17880 [[nodiscard]]
size_t find_last_not_of(
const string_t&str)
const noexcept(find_nothrow){
17882 if(str._in_str_cso())
17883 return find_last_not_of(str._get_cso_constexpr_str());
17884 elseif(str._in_cso())
17885 return find_last_not_of(str.to_string_view_t());
17887 return find_last_not_of(str.to_string_view_t());
17889 [[nodiscard]]
size_t find_last_not_of(const char_T*str)const noexcept(find_nothrow){
17890 return find_last_not_of(string_view_t(str));
17892 [[nodiscard]]
size_t find_last_not_of(char_T ch)
const noexcept(find_nothrow){
17893 return find_last_not_of(string_view_t{&ch,1});
17895 [[nodiscard]]
size_t find_last_not_of(
const arec_t&&ch)
const noexcept(find_nothrow){
17896 return find_last_not_of(move(ch).
operator char_T());
17901 [[nodiscard]]string_t arec(
size_t index,char_T delimiter)
const{
17902 auto pos=find(delimiter);
17903 auto end=find(delimiter,pos);
17906 end=find(delimiter,pos);
17908 return substr(pos,end-pos);
17910 [[nodiscard]]string_t arec(
size_t index,string_view_t delimiter_str)
const{
17911 auto pos=find(delimiter_str);
17912 auto end=find(delimiter_str,pos);
17915 end=find(delimiter_str,pos);
17917 return substr(pos,end-pos);
17919 [[nodiscard]]string_t arec(
size_t index,
const string_t&delimiter_str)
const{
17920 auto pos=find(delimiter_str);
17921 auto end=find(delimiter_str,pos);
17924 end=find(delimiter_str,pos);
17926 return substr(pos,end-pos);
17928 [[nodiscard]]string_t arec(
size_t index,constexpr_str_t&delimiter_str)
const{
17929 auto pos=find(delimiter_str);
17930 auto end=find(delimiter_str,pos);
17933 end=find(delimiter_str,pos);
17935 return substr(pos,end-pos);
17940 void erase(
size_t pos,
size_t size=1)&
noexcept{
17941 _cso_check();_m=_m->do_erase(pos,size);
17943 void insert(
size_t pos,
const string_t& str)&
noexcept{
17945 full_copy_cso_check(str);
17947 _m=_m->do_insert(pos,str.to_string_view_t());
17949 _m=_m->do_insert(pos,str);
17951 void insert(
size_t pos,string_view_t str)&
noexcept{
17952 _cso_check();_m=_m->do_insert(pos,str);
17954 void insert(
size_t pos,
const char_T* str)&
noexcept{
17955 insert(pos,string_view_t(str));
17957 void insert(
size_t pos,char_T ch)&
noexcept{
17958 insert(pos,string_view_t{&ch,1});
17964 constexpr bool contains(string_view_t str)
const noexcept{
17965 return find(str) != npos;
17967 constexpr bool contains(constexpr_str_t&str)
const noexcept{
17968 return find(str) != npos;
17970 constexpr bool contains(
const string_t&str)
const noexcept{
17971 return find(str) != npos;
17973 constexpr bool contains(char_T ch)
const noexcept{
17974 return find(ch) != npos;
17976 constexpr bool contains(
const char_T*str)
const noexcept{
17977 return find(str) != npos;
17981 constexpr bool starts_with(string_view_t str)
const noexcept{
17982 if(size()<str.size())
17984 return substr(0,str.size()) == str;
17986 constexpr bool starts_with(constexpr_str_t&str)
const noexcept{
17987 if(size()<str.size())
17989 return substr(0,str.size()) == str;
17991 constexpr bool starts_with(
const string_t&str)
const noexcept{
17992 if(size()<str.size())
17994 if(str._in_chr_cso())
17995 return starts_with(str._cso_info._ch);
17997 return substr(0,str.size()) == str;
17999 constexpr bool starts_with(char_T ch)
const noexcept{
18002 return operator[](0) == ch;
18004 constexpr bool starts_with(
const char_T*str)
const noexcept{
18005 return starts_with(string_view_t{str});
18009 constexpr bool ends_with(string_view_t str)
const noexcept{
18010 if(size()<str.size())
18012 return substr(size()-str.size()) == str;
18014 constexpr bool ends_with(constexpr_str_t&str)
const noexcept{
18015 if(size()<str.size())
18017 return substr(size()-str.size()) == str;
18019 constexpr bool ends_with(
const string_t&str)
const noexcept{
18020 if(size()<str.size())
18022 if(str._in_chr_cso())
18023 return ends_with(str._cso_info._ch);
18025 return substr(size()-str.size()) == str;
18027 constexpr bool ends_with(char_T ch)
const noexcept{
18030 return operator[](size()-1) == ch;
18032 constexpr bool ends_with(
const char_T*str)
const noexcept{
18033 return ends_with(string_view_t{str});
18036 this_t& append(
size_t size,char_T ch)
noexcept{
18037 return *
this+=string_t{size,ch};
18047 template<
class char_T>
18048 string_t(
const char_T*) -> string_t<char_T>;
18049 template<
class char_T>
18050 string_t(char_T*) -> string_t<char_T>;
18053 template<
typename T>
18054 inline void swap(string_t<T>& a,string_t<T>& b)
noexcept{ a.swap_with(b); }
18057 template<
typename some_fucking_std_ostream,
typename T>
18058 decltype(
auto)
operator<<(some_fucking_std_ostream& stream,
const string_t<T>& str){
18059 typedef some_fucking_std_ostream stream_t;
18060 typedef stream_t::traits_type traits_t;
18061 typename stream_t::iostate state = stream_t::goodbit;
18063 suppress_msvc_warning(26494);
18065 size_t size = str.size();
18066 if(stream.width() <= 0 ||
static_cast<size_t>(stream.width()) <= size)
18069 pad =
static_cast<size_t>(stream.width()) - size;
18071 const typename stream_t::sentry isok(stream);
18074 state |= stream_t::badbit;
18077 if((stream.flags() & stream_t::adjustfield) != stream_t::left){
18078 for(; 0 < pad; --pad){
18079 if(traits_t::eq_int_type(traits_t::eof(), stream.rdbuf()->sputc(stream.fill()))){
18080 state |= stream_t::badbit;
18086 if(state == stream_t::goodbit && stream.rdbuf()->sputn(str.c_str(),
static_cast<::std::streamsize
>(size)) !=
static_cast<::std::streamsize
>(size))
18087 state |= stream_t::badbit;
18089 for(; 0 < pad; --pad){
18090 if(traits_t::eq_int_type(traits_t::eof(), stream.rdbuf()->sputc(stream.fill()))){
18091 state |= stream_t::badbit;
18100 stream.setstate(stream_t::badbit,
true);
18104 stream.setstate(state);
18110 [[nodiscard]]
inline auto size_of_array_like(
const string_t<remove_cv<T>>& a)
noexcept{
return a.size(); }
18112 [[nodiscard]]
inline auto begin_of_array_like(string_t<remove_cv<T>>& a)
noexcept{
return a.c_str(); }
18114 [[nodiscard]]
inline auto begin_of_array_like(
const string_t<remove_cv<T>>& a)
noexcept{
return a.c_str(); }
18117 typedef string_t<char_t>string;
18119 using string_n::string_t;
18120 using string_n::string;
18124 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
18126 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
18134 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
18145 #if defined(_MSC_VER)
18146 #pragma warning(pop)
18148 #undef suppress_msvc_warning
18149 #undef disable_msvc_warning
18150 #undef push_msvc_warning
18151 #undef pop_msvc_warning
18152 #undef push_and_disable_msvc_warning
18155 #undef BIT_POSSIBILITY
18157 #if defined(ELC_VOID_NAME)
18158 #define void the_void
18163 #undef noexcept_as_auto
18164 #undef constexpr_as
18165 #undef constexpr_as_auto
18167 #undef using_method_from_base_t
18168 #undef using_method_from_value
18173 #undef re_declvalue
18178 #undef template_error
18179 #undef template_warning
18181 #undef type_info_of
18182 #undef type_name_of
18184 #undef is_common_attribute
18185 #undef is_special_attribute
18187 #undef has_attribute
18188 #undef not_has_attribute
18190 #undef float_size_of
18193 #undef def_common_attribute_with_nothing
18194 #undef def_special_attribute_with_nothing
18196 #undef common_attribute_t
18197 #undef special_attribute_t
18200 #undef enabled_by_default
18201 #undef disabled_by_default
18202 #undef enable_if_not_ill_form
18205 #undef was_an_ill_form
18206 #undef was_an_ill_form_with_parameter
18207 #undef was_not_an_ill_form
18208 #undef was_not_an_ill_form_and_noexcept
18209 #undef was_not_an_ill_form_with_parameter
18211 #undef recursive_lambda
18212 #undef get_recursive_lambda_caller
18214 #undef lambda_with_catch
18215 #undef self_recursion
18216 #undef lambda_RLSRRS
18224 #undef _small_than_
18226 #if defined(_MSC_VER)
18232 #undef INTER_NAMESPACE
18233 #undef BREAK_NAMESPACE
18238 #undef template_name
18241 #undef not_in_debug
18246 #undef ELC_TEST_EVENTNAME
18248 #undef override_instance_struct
18252 #undef force_inline
18254 #undef with_no_vtable
18256 #undef in_consteval
18258 #undef no_vtable_struct
18259 #undef no_vtable_class
18263 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
18267 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
18270 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18283 #if !defined(ELC_APIS_str_code_convert)
18284 #define ELC_APIS_str_code_convert
18287 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/default_data_type.hpp"
18297 typedef char32_t char_t;
18299 typedef int64_t int_t;
18301 typedef uint64_t uint_t;
18303 typedef double float_t;
18305 typedef long double float_size_t;
18310 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18311 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
18320 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
18324 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18325 namespace elc::APIs::str_code_convert{
18326 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18338 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18340 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
18351 #define BIT_POSSIBILITY 2
18355 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18357 #if defined(_MSC_VER)
18358 #pragma warning(push,ELC_WARNING_LEVEL)
18359 #pragma warning(disable:4099)
18360 #pragma warning(disable:26812)
18361 #pragma warning(disable:4584)
18362 #pragma warning(disable:4250)
18363 #pragma warning(disable:26432)
18364 #pragma warning(disable:26435)
18365 #pragma warning(disable:26481)
18366 #pragma warning(disable:26446)
18367 #pragma warning(disable:26434)
18368 #pragma warning(disable:26429)
18369 #pragma warning(disable:26471)
18370 #pragma warning(disable:26474)
18371 #pragma warning(disable:26473)
18372 #pragma warning(disable:26456)
18373 #pragma warning(disable:26485)
18374 #pragma warning(disable:26490)
18375 #pragma warning(disable:26472)
18376 #pragma warning(disable:26482)
18377 #pragma warning(disable:26493)
18379 #if defined(_MSC_VER)
18380 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
18381 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
18382 #define push_msvc_warning() __pragma(warning(push))
18383 #define pop_msvc_warning() __pragma(warning(pop))
18384 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
18386 #define suppress_msvc_warning(...)
18387 #define disable_msvc_warning(...)
18388 #define push_msvc_warning()
18389 #define pop_msvc_warning()
18390 #define push_and_disable_msvc_warning(...)
18393 #if defined(ELC_VOID_NAME)
18398 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
18399 #define noexcept_as_auto MAGIC
18400 #define constexpr_as(...) MAGIC constexpr
18401 #define constexpr_as_auto MAGIC MAGIC constexpr
18403 #define using_method_from_base_t(name,...) \
18404 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
18405 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
18407 return base_t::name(forward<Args>(rest)...);\
18410 #define using_method_from_value(name,value_name,...) \
18411 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
18412 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
18414 return value_name.name(forward<Args>(rest)...);\
18417 #define floop while(__builtin_is_my_dick_still_there())
18418 #define enable_adl(name) void name()noexcept=delete
18420 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
18421 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
18423 #define declvalue(...) (::std::declval<__VA_ARGS__>())
18426 #define template_error(reason) static_assert(template_error_helper<T>,reason)
18428 #define template_warning(reason) template_warning_helper<T>(reason)
18431 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
18432 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
18434 #define is_common_attribute(name) public attribute<T,name<T>>
18435 #define is_special_attribute(name) public attribute<T,name>
18437 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
18438 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
18441 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
18443 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
18446 #define def_common_attribute_with_nothing(name) \
18447 template<typename T>\
18450 #define def_special_attribute_with_nothing(name) \
18453 #define common_attribute_t template<class>class
18454 #define special_attribute_t class
18464 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
18466 #define enabled_by_default class enable_state=void
18468 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
18470 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
18472 #define enable_flag class enable_state
18474 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
18475 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
18476 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
18477 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
18478 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
18481 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
18483 #define get_recursive_lambda_caller(name) \
18484 lambda_with_catch(&)(auto&&...Args){\
18485 return name(name,Args...);\
18490 #define lambda_with_catch(...) [__VA_ARGS__]
18492 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
18494 #define lambda_RLSRRS _my_jb_super_sb_name_
18502 #define elseif else if
18504 #define _big_than_ >
18506 #define _small_than_ <
18508 #if defined(_MSC_VER)
18515 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
18517 #define BREAK_NAMESPACE }
18520 #define template_name template
18522 #define type_name class
18524 #if defined(DEBUG) || defined(_DEBUG)
18525 #define not_in_debug 0
18527 #define not_in_debug 1
18531 #define ec(ch) U ## ch
18533 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
18534 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
18536 #define ELC_TEST_EVENTNAME(name)
18539 #define override_instance_struct \
18541 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
18542 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
18543 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
18544 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
18545 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
18547 #if defined(_WIN32)
18548 #define distinctive __declspec(dllexport)
18550 #define distinctive
18553 #if defined(_WIN32)
18554 #define force_inline __forceinline
18555 #elif defined(__GNUC__)
18556 #define force_inline __attribute__((always_inline)) inline
18558 #define force_inline inline
18561 #if defined(_WIN32)
18562 #define with_no_vtable __declspec(novtable)
18564 #define with_no_vtable
18567 #define in_consteval (::std::is_constant_evaluated())
18569 #define no_vtable_struct struct with_no_vtable
18570 #define no_vtable_class class with_no_vtable
18574 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18576 using namespace ::elc::defs;
18578 [[nodiscard]]
inline string_t<char> to_char_str(string_view_t<char_t> a)
noexcept{
18579 string_t<char>aret;
18580 ::std::mbstate_t stat{};
18581 string_t old_lc=::std::setlocale(LC_CTYPE,
nullptr);
18582 if(::std::setlocale(LC_CTYPE,
"en_US.utf8")==
nullptr)
18583 die_with(locale::str::setlocale_error);
18584 push_and_disable_msvc_warning(26494)
18585 char r[MB_LEN_MAX];
18587 pop_msvc_warning();
18589 s=::std::c32rtomb(r,c,&stat);
18591 die_with(locale::str::code_convert_error);
18592 aret+=string_view_t<char>{(
char*)r,note::size((
size_t)s)};
18594 ::std::setlocale(LC_CTYPE,old_lc.c_str());
18597 [[nodiscard]]
inline string_t<char_t> to_char_t_str(string_view_t<char> a)
noexcept{
18598 string_t<char_t>aret;
18599 ::std::mbstate_t stat{};
18600 string_t old_lc=::std::setlocale(LC_CTYPE,
nullptr);
18601 if(::std::setlocale(LC_CTYPE,
"en_US.utf8")==
nullptr)
18602 die_with(locale::str::setlocale_error);
18603 push_and_disable_msvc_warning(26494);
18606 pop_msvc_warning();
18607 auto i=a.cbegin(),e=a.cend();
18609 s=::std::mbrtoc32(&c,i,MB_LEN_MAX,&stat);
18611 die_with(locale::str::code_convert_error);
18615 ::std::setlocale(LC_CTYPE,old_lc.c_str());
18619 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
18630 #if defined(_MSC_VER)
18631 #pragma warning(pop)
18633 #undef suppress_msvc_warning
18634 #undef disable_msvc_warning
18635 #undef push_msvc_warning
18636 #undef pop_msvc_warning
18637 #undef push_and_disable_msvc_warning
18640 #undef BIT_POSSIBILITY
18642 #if defined(ELC_VOID_NAME)
18643 #define void the_void
18648 #undef noexcept_as_auto
18649 #undef constexpr_as
18650 #undef constexpr_as_auto
18652 #undef using_method_from_base_t
18653 #undef using_method_from_value
18658 #undef re_declvalue
18663 #undef template_error
18664 #undef template_warning
18666 #undef type_info_of
18667 #undef type_name_of
18669 #undef is_common_attribute
18670 #undef is_special_attribute
18672 #undef has_attribute
18673 #undef not_has_attribute
18675 #undef float_size_of
18678 #undef def_common_attribute_with_nothing
18679 #undef def_special_attribute_with_nothing
18681 #undef common_attribute_t
18682 #undef special_attribute_t
18685 #undef enabled_by_default
18686 #undef disabled_by_default
18687 #undef enable_if_not_ill_form
18690 #undef was_an_ill_form
18691 #undef was_an_ill_form_with_parameter
18692 #undef was_not_an_ill_form
18693 #undef was_not_an_ill_form_and_noexcept
18694 #undef was_not_an_ill_form_with_parameter
18696 #undef recursive_lambda
18697 #undef get_recursive_lambda_caller
18699 #undef lambda_with_catch
18700 #undef self_recursion
18701 #undef lambda_RLSRRS
18709 #undef _small_than_
18711 #if defined(_MSC_VER)
18717 #undef INTER_NAMESPACE
18718 #undef BREAK_NAMESPACE
18723 #undef template_name
18726 #undef not_in_debug
18731 #undef ELC_TEST_EVENTNAME
18733 #undef override_instance_struct
18737 #undef force_inline
18739 #undef with_no_vtable
18741 #undef in_consteval
18743 #undef no_vtable_struct
18744 #undef no_vtable_class
18748 #line 65 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
18750 namespace elc::defs{
18751 using namespace elc::APIs::str_code_convert;
18757 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
18758 namespace elc::defs{
18759 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
18767 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18779 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18781 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
18792 #define BIT_POSSIBILITY 2
18796 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
18798 #if defined(_MSC_VER)
18799 #pragma warning(push,ELC_WARNING_LEVEL)
18800 #pragma warning(disable:4099)
18801 #pragma warning(disable:26812)
18802 #pragma warning(disable:4584)
18803 #pragma warning(disable:4250)
18804 #pragma warning(disable:26432)
18805 #pragma warning(disable:26435)
18806 #pragma warning(disable:26481)
18807 #pragma warning(disable:26446)
18808 #pragma warning(disable:26434)
18809 #pragma warning(disable:26429)
18810 #pragma warning(disable:26471)
18811 #pragma warning(disable:26474)
18812 #pragma warning(disable:26473)
18813 #pragma warning(disable:26456)
18814 #pragma warning(disable:26485)
18815 #pragma warning(disable:26490)
18816 #pragma warning(disable:26472)
18817 #pragma warning(disable:26482)
18818 #pragma warning(disable:26493)
18820 #if defined(_MSC_VER)
18821 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
18822 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
18823 #define push_msvc_warning() __pragma(warning(push))
18824 #define pop_msvc_warning() __pragma(warning(pop))
18825 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
18827 #define suppress_msvc_warning(...)
18828 #define disable_msvc_warning(...)
18829 #define push_msvc_warning()
18830 #define pop_msvc_warning()
18831 #define push_and_disable_msvc_warning(...)
18834 #if defined(ELC_VOID_NAME)
18839 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
18840 #define noexcept_as_auto MAGIC
18841 #define constexpr_as(...) MAGIC constexpr
18842 #define constexpr_as_auto MAGIC MAGIC constexpr
18844 #define using_method_from_base_t(name,...) \
18845 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
18846 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
18848 return base_t::name(forward<Args>(rest)...);\
18851 #define using_method_from_value(name,value_name,...) \
18852 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
18853 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
18855 return value_name.name(forward<Args>(rest)...);\
18858 #define floop while(__builtin_is_my_dick_still_there())
18859 #define enable_adl(name) void name()noexcept=delete
18861 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
18862 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
18864 #define declvalue(...) (::std::declval<__VA_ARGS__>())
18867 #define template_error(reason) static_assert(template_error_helper<T>,reason)
18869 #define template_warning(reason) template_warning_helper<T>(reason)
18872 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
18873 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
18875 #define is_common_attribute(name) public attribute<T,name<T>>
18876 #define is_special_attribute(name) public attribute<T,name>
18878 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
18879 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
18882 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
18884 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
18887 #define def_common_attribute_with_nothing(name) \
18888 template<typename T>\
18891 #define def_special_attribute_with_nothing(name) \
18894 #define common_attribute_t template<class>class
18895 #define special_attribute_t class
18905 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
18907 #define enabled_by_default class enable_state=void
18909 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
18911 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
18913 #define enable_flag class enable_state
18915 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
18916 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
18917 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
18918 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
18919 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
18922 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
18924 #define get_recursive_lambda_caller(name) \
18925 lambda_with_catch(&)(auto&&...Args){\
18926 return name(name,Args...);\
18931 #define lambda_with_catch(...) [__VA_ARGS__]
18933 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
18935 #define lambda_RLSRRS _my_jb_super_sb_name_
18943 #define elseif else if
18945 #define _big_than_ >
18947 #define _small_than_ <
18949 #if defined(_MSC_VER)
18956 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
18958 #define BREAK_NAMESPACE }
18961 #define template_name template
18963 #define type_name class
18965 #if defined(DEBUG) || defined(_DEBUG)
18966 #define not_in_debug 0
18968 #define not_in_debug 1
18972 #define ec(ch) U ## ch
18974 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
18975 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
18977 #define ELC_TEST_EVENTNAME(name)
18980 #define override_instance_struct \
18982 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
18983 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
18984 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
18985 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
18986 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
18988 #if defined(_WIN32)
18989 #define distinctive __declspec(dllexport)
18991 #define distinctive
18994 #if defined(_WIN32)
18995 #define force_inline __forceinline
18996 #elif defined(__GNUC__)
18997 #define force_inline __attribute__((always_inline)) inline
18999 #define force_inline inline
19002 #if defined(_WIN32)
19003 #define with_no_vtable __declspec(novtable)
19005 #define with_no_vtable
19008 #define in_consteval (::std::is_constant_evaluated())
19010 #define no_vtable_struct struct with_no_vtable
19011 #define no_vtable_class class with_no_vtable
19015 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19019 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19021 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/literal.hpp"
19030 template<constexpr_str_n::constexpr_str_t_literal_helper str_helper>
19031 inline constexpr string operator""_elc_string()noexcept{
19032 return string(constexpr_str_n::operator
""_constexpr_str<str_helper>());
19037 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19039 #if defined(ELC_TEST_ON)
19040 namespace string_part_test{
19041 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_test.hpp"
19049 inline void test(){
19050 ELC_TEST_EVENTNAME(
"string部分测试");
19054 stest_accert(a.size()==0);
19056 stest_accert(a.size()==3);
19058 stest_accert(a.size()==6);
19060 stest_accert(es
"asd"+a==es
"asdasdasdasd");
19062 stest_accert(a.substr(0,3)==es
"aed");
19063 stest_accert(a.substr(3).size()==6);
19064 stest_accert(a[2]==ec(
'd'));
19066 stest_accert(a.size()==0);
19067 a.resize(3,ec(
'd'));
19068 stest_accert(a==es
"ddd");
19069 for(
const char_t&c:a)
19070 stest_accert(c==ec(
'd'));
19072 stest_accert(a.begin()==a.cbegin());
19073 stest_accert(*a.begin()==ec(
'a'));
19074 stest_accert(a.begin()<=a.cend());
19075 stest_accert(*a.rbegin()==ec(
'c'));
19076 stest_accert(a.rbegin()<=a.rend());
19077 stest_accert(a.rbegin()==a.end()-1);
19078 a.push_back(es
"as");
19079 a.push_front(ec(
'p'));
19080 stest_accert(a == es
"pabcas");
19083 stest_accert(a == es
"ps");
19084 stest_accert(a.pop_front() == ec(
'p'));
19085 stest_accert(a.pop_back() == ec(
's'));
19086 stest_accert(a.size() == 0);
19088 stest_accert(a.pop_back(2) == es
"bc");
19089 stest_accert(a.size() == 1);
19090 a.push_front(es
"wqer");
19091 stest_accert(a==es
"wqera");
19092 a.insert(2,es
"123");
19093 a.insert(0,es
"123");
19094 a.insert(a.size(),es
"123");
19095 stest_accert(a[2] == ec(
'3'));
19100 stest_accert(a == es
"123wq6666ra123");
19101 for(char_t& c: a.view())
19103 stest_accert(a == es
"77777777777777");
19106 using namespace elc;
19107 using elc::defs::hash;
19108 auto a = es
"ab"_elc_string;
19109 stest_accert(hash(a) == hash(string_view(es
"ab")));
19111 stest_accert(hash(b) == hash(string_view(es
"ab")));
19112 stest_accert(b.memory_cost() > a.memory_cost());
19115 stest_accert(hash(a) == hash(string_view(es
"abab")));
19117 stest_accert(hash(a) == hash(string_view(es
"acbab")));
19119 stest_accert(hash(a) == hash(string_view(es
"ac")));
19120 a.push_back(es
"123");
19121 stest_accert(hash(a) == hash(string_view(es
"ac123")));
19122 a.push_front(es
"123");
19123 stest_accert(hash(a) == hash(string_view(es
"123ac123")));
19126 check_memory_lack();
19128 inline void test_log_out(){
19130 inline void test_end(){
19135 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19139 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19147 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
19158 #if defined(_MSC_VER)
19159 #pragma warning(pop)
19161 #undef suppress_msvc_warning
19162 #undef disable_msvc_warning
19163 #undef push_msvc_warning
19164 #undef pop_msvc_warning
19165 #undef push_and_disable_msvc_warning
19168 #undef BIT_POSSIBILITY
19170 #if defined(ELC_VOID_NAME)
19171 #define void the_void
19176 #undef noexcept_as_auto
19177 #undef constexpr_as
19178 #undef constexpr_as_auto
19180 #undef using_method_from_base_t
19181 #undef using_method_from_value
19186 #undef re_declvalue
19191 #undef template_error
19192 #undef template_warning
19194 #undef type_info_of
19195 #undef type_name_of
19197 #undef is_common_attribute
19198 #undef is_special_attribute
19200 #undef has_attribute
19201 #undef not_has_attribute
19203 #undef float_size_of
19206 #undef def_common_attribute_with_nothing
19207 #undef def_special_attribute_with_nothing
19209 #undef common_attribute_t
19210 #undef special_attribute_t
19213 #undef enabled_by_default
19214 #undef disabled_by_default
19215 #undef enable_if_not_ill_form
19218 #undef was_an_ill_form
19219 #undef was_an_ill_form_with_parameter
19220 #undef was_not_an_ill_form
19221 #undef was_not_an_ill_form_and_noexcept
19222 #undef was_not_an_ill_form_with_parameter
19224 #undef recursive_lambda
19225 #undef get_recursive_lambda_caller
19227 #undef lambda_with_catch
19228 #undef self_recursion
19229 #undef lambda_RLSRRS
19237 #undef _small_than_
19239 #if defined(_MSC_VER)
19245 #undef INTER_NAMESPACE
19246 #undef BREAK_NAMESPACE
19251 #undef template_name
19254 #undef not_in_debug
19259 #undef ELC_TEST_EVENTNAME
19261 #undef override_instance_struct
19265 #undef force_inline
19267 #undef with_no_vtable
19269 #undef in_consteval
19271 #undef no_vtable_struct
19272 #undef no_vtable_class
19276 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19280 #line 31 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19283 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_export.hpp"
19292 #define export using defs::
19295 export string_view_t;
19296 export string_view;
19297 export
operator""_elc_string;
19298 export
operator""_constexpr_str;
19303 #line 34 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19305 #if defined(ELC_CORE)
19306 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
19316 namespace elc::defs{
19317 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19325 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19337 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19339 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
19350 #define BIT_POSSIBILITY 2
19354 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19356 #if defined(_MSC_VER)
19357 #pragma warning(push,ELC_WARNING_LEVEL)
19358 #pragma warning(disable:4099)
19359 #pragma warning(disable:26812)
19360 #pragma warning(disable:4584)
19361 #pragma warning(disable:4250)
19362 #pragma warning(disable:26432)
19363 #pragma warning(disable:26435)
19364 #pragma warning(disable:26481)
19365 #pragma warning(disable:26446)
19366 #pragma warning(disable:26434)
19367 #pragma warning(disable:26429)
19368 #pragma warning(disable:26471)
19369 #pragma warning(disable:26474)
19370 #pragma warning(disable:26473)
19371 #pragma warning(disable:26456)
19372 #pragma warning(disable:26485)
19373 #pragma warning(disable:26490)
19374 #pragma warning(disable:26472)
19375 #pragma warning(disable:26482)
19376 #pragma warning(disable:26493)
19378 #if defined(_MSC_VER)
19379 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
19380 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
19381 #define push_msvc_warning() __pragma(warning(push))
19382 #define pop_msvc_warning() __pragma(warning(pop))
19383 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
19385 #define suppress_msvc_warning(...)
19386 #define disable_msvc_warning(...)
19387 #define push_msvc_warning()
19388 #define pop_msvc_warning()
19389 #define push_and_disable_msvc_warning(...)
19392 #if defined(ELC_VOID_NAME)
19397 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
19398 #define noexcept_as_auto MAGIC
19399 #define constexpr_as(...) MAGIC constexpr
19400 #define constexpr_as_auto MAGIC MAGIC constexpr
19402 #define using_method_from_base_t(name,...) \
19403 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
19404 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
19406 return base_t::name(forward<Args>(rest)...);\
19409 #define using_method_from_value(name,value_name,...) \
19410 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
19411 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
19413 return value_name.name(forward<Args>(rest)...);\
19416 #define floop while(__builtin_is_my_dick_still_there())
19417 #define enable_adl(name) void name()noexcept=delete
19419 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
19420 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
19422 #define declvalue(...) (::std::declval<__VA_ARGS__>())
19425 #define template_error(reason) static_assert(template_error_helper<T>,reason)
19427 #define template_warning(reason) template_warning_helper<T>(reason)
19430 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
19431 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
19433 #define is_common_attribute(name) public attribute<T,name<T>>
19434 #define is_special_attribute(name) public attribute<T,name>
19436 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
19437 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
19440 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
19442 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
19445 #define def_common_attribute_with_nothing(name) \
19446 template<typename T>\
19449 #define def_special_attribute_with_nothing(name) \
19452 #define common_attribute_t template<class>class
19453 #define special_attribute_t class
19463 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
19465 #define enabled_by_default class enable_state=void
19467 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
19469 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
19471 #define enable_flag class enable_state
19473 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
19474 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
19475 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
19476 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
19477 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
19480 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
19482 #define get_recursive_lambda_caller(name) \
19483 lambda_with_catch(&)(auto&&...Args){\
19484 return name(name,Args...);\
19489 #define lambda_with_catch(...) [__VA_ARGS__]
19491 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
19493 #define lambda_RLSRRS _my_jb_super_sb_name_
19501 #define elseif else if
19503 #define _big_than_ >
19505 #define _small_than_ <
19507 #if defined(_MSC_VER)
19514 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
19516 #define BREAK_NAMESPACE }
19519 #define template_name template
19521 #define type_name class
19523 #if defined(DEBUG) || defined(_DEBUG)
19524 #define not_in_debug 0
19526 #define not_in_debug 1
19530 #define ec(ch) U ## ch
19532 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
19533 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
19535 #define ELC_TEST_EVENTNAME(name)
19538 #define override_instance_struct \
19540 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
19541 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
19542 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
19543 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
19544 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
19546 #if defined(_WIN32)
19547 #define distinctive __declspec(dllexport)
19549 #define distinctive
19552 #if defined(_WIN32)
19553 #define force_inline __forceinline
19554 #elif defined(__GNUC__)
19555 #define force_inline __attribute__((always_inline)) inline
19557 #define force_inline inline
19560 #if defined(_WIN32)
19561 #define with_no_vtable __declspec(novtable)
19563 #define with_no_vtable
19566 #define in_consteval (::std::is_constant_evaluated())
19568 #define no_vtable_struct struct with_no_vtable
19569 #define no_vtable_class class with_no_vtable
19573 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19577 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
19579 namespace string_n{
19580 template<
class char_T>
19581 value arec_as_value(string_t<char_T>&str,
const value index){
19582 size_t i=size_t(use_as<int_t>(index));
19584 i=size_t(use_as<uint_t>(index));
19585 struct arec_data_t final:instance_struct<arec_data_t>
19586 ,value::base_data_t{
19587 typename string_t<char_T>::arec_t _m;
19588 arec_data_t(string_t<char_T>&str,
size_t index)
noexcept:_m(&str,index){};
19589 arec_data_t(
const arec_data_t&ref)
noexcept:_m(special_init,ref._m){}
19590 virtual ~arec_data_t()noexcept override final=default;
19592 virtual
void be_set(ptr a)noexcept override final{move(_m)=use_as<char_T>(a);}
19593 [[nodiscard]]
virtual ptr get_value()noexcept override final{
return core::make_binary_node_from<char_T>(move(_m));}
19594 [[nodiscard]]
virtual base_data_t*copy()const noexcept override final{
return get<arec_data_t>(*
this);}
19595 [[nodiscard]]
virtual base_type_info_t get_type_info()const noexcept override final{
return type_info<arec_data_t>;}
19597 return get<arec_data_t>(str,i);
19601 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19609 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
19620 #if defined(_MSC_VER)
19621 #pragma warning(pop)
19623 #undef suppress_msvc_warning
19624 #undef disable_msvc_warning
19625 #undef push_msvc_warning
19626 #undef pop_msvc_warning
19627 #undef push_and_disable_msvc_warning
19630 #undef BIT_POSSIBILITY
19632 #if defined(ELC_VOID_NAME)
19633 #define void the_void
19638 #undef noexcept_as_auto
19639 #undef constexpr_as
19640 #undef constexpr_as_auto
19642 #undef using_method_from_base_t
19643 #undef using_method_from_value
19648 #undef re_declvalue
19653 #undef template_error
19654 #undef template_warning
19656 #undef type_info_of
19657 #undef type_name_of
19659 #undef is_common_attribute
19660 #undef is_special_attribute
19662 #undef has_attribute
19663 #undef not_has_attribute
19665 #undef float_size_of
19668 #undef def_common_attribute_with_nothing
19669 #undef def_special_attribute_with_nothing
19671 #undef common_attribute_t
19672 #undef special_attribute_t
19675 #undef enabled_by_default
19676 #undef disabled_by_default
19677 #undef enable_if_not_ill_form
19680 #undef was_an_ill_form
19681 #undef was_an_ill_form_with_parameter
19682 #undef was_not_an_ill_form
19683 #undef was_not_an_ill_form_and_noexcept
19684 #undef was_not_an_ill_form_with_parameter
19686 #undef recursive_lambda
19687 #undef get_recursive_lambda_caller
19689 #undef lambda_with_catch
19690 #undef self_recursion
19691 #undef lambda_RLSRRS
19699 #undef _small_than_
19701 #if defined(_MSC_VER)
19707 #undef INTER_NAMESPACE
19708 #undef BREAK_NAMESPACE
19713 #undef template_name
19716 #undef not_in_debug
19721 #undef ELC_TEST_EVENTNAME
19723 #undef override_instance_struct
19727 #undef force_inline
19729 #undef with_no_vtable
19731 #undef in_consteval
19733 #undef no_vtable_struct
19734 #undef no_vtable_class
19738 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
19742 #line 35 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_multi/string_arec_as_value.hpp"
19747 #line 37 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/string/_body.hpp"
19752 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19757 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
19758 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
19767 #if defined(ELC_TEST)
19768 #error "this part cannot be tested."
19771 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
19784 #line 70 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
19788 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
19789 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
19802 #if !defined(ELC_APIS_library_load)
19803 #define ELC_APIS_library_load
19804 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/decl_system_type.hpp"
19816 #if defined(__linux)||defined(__linux__)||defined(__gnu_linux__)
19817 #define SYSTEM_TYPE linux
19818 #elif defined(_WIN32)||defined(__MINGW32__)||defined(__CYGWIN__)
19819 #define SYSTEM_TYPE windows
19821 #define SYSTEM_TYPE other
19823 #define ERROR_MSG_UNABLE_OS "Unable OS,edit this file on your own or contact ELC's producers."
19827 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
19828 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19837 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19841 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
19842 #if SYSTEM_TYPE == linux
19844 #elif SYSTEM_TYPE == windows
19846 #include <Windows.h>
19847 #include <Libloaderapi.h>
19848 #include <Errhandlingapi.h>
19850 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
19859 #if !defined(ELC_NUMERICAL_REPRESENTATION)
19860 #define ELC_NUMERICAL_REPRESENTATION
19861 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19870 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
19874 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
19875 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
19884 #if defined(ELC_TEST)
19885 #error "this part cannot be tested."
19887 namespace elc::defs{
19888 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
19896 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19908 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19910 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
19921 #define BIT_POSSIBILITY 2
19925 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
19927 #if defined(_MSC_VER)
19928 #pragma warning(push,ELC_WARNING_LEVEL)
19929 #pragma warning(disable:4099)
19930 #pragma warning(disable:26812)
19931 #pragma warning(disable:4584)
19932 #pragma warning(disable:4250)
19933 #pragma warning(disable:26432)
19934 #pragma warning(disable:26435)
19935 #pragma warning(disable:26481)
19936 #pragma warning(disable:26446)
19937 #pragma warning(disable:26434)
19938 #pragma warning(disable:26429)
19939 #pragma warning(disable:26471)
19940 #pragma warning(disable:26474)
19941 #pragma warning(disable:26473)
19942 #pragma warning(disable:26456)
19943 #pragma warning(disable:26485)
19944 #pragma warning(disable:26490)
19945 #pragma warning(disable:26472)
19946 #pragma warning(disable:26482)
19947 #pragma warning(disable:26493)
19949 #if defined(_MSC_VER)
19950 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
19951 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
19952 #define push_msvc_warning() __pragma(warning(push))
19953 #define pop_msvc_warning() __pragma(warning(pop))
19954 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
19956 #define suppress_msvc_warning(...)
19957 #define disable_msvc_warning(...)
19958 #define push_msvc_warning()
19959 #define pop_msvc_warning()
19960 #define push_and_disable_msvc_warning(...)
19963 #if defined(ELC_VOID_NAME)
19968 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
19969 #define noexcept_as_auto MAGIC
19970 #define constexpr_as(...) MAGIC constexpr
19971 #define constexpr_as_auto MAGIC MAGIC constexpr
19973 #define using_method_from_base_t(name,...) \
19974 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
19975 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
19977 return base_t::name(forward<Args>(rest)...);\
19980 #define using_method_from_value(name,value_name,...) \
19981 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
19982 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
19984 return value_name.name(forward<Args>(rest)...);\
19987 #define floop while(__builtin_is_my_dick_still_there())
19988 #define enable_adl(name) void name()noexcept=delete
19990 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
19991 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
19993 #define declvalue(...) (::std::declval<__VA_ARGS__>())
19996 #define template_error(reason) static_assert(template_error_helper<T>,reason)
19998 #define template_warning(reason) template_warning_helper<T>(reason)
20001 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
20002 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
20004 #define is_common_attribute(name) public attribute<T,name<T>>
20005 #define is_special_attribute(name) public attribute<T,name>
20007 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
20008 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
20011 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
20013 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
20016 #define def_common_attribute_with_nothing(name) \
20017 template<typename T>\
20020 #define def_special_attribute_with_nothing(name) \
20023 #define common_attribute_t template<class>class
20024 #define special_attribute_t class
20034 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
20036 #define enabled_by_default class enable_state=void
20038 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
20040 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
20042 #define enable_flag class enable_state
20044 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
20045 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
20046 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
20047 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
20048 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
20051 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
20053 #define get_recursive_lambda_caller(name) \
20054 lambda_with_catch(&)(auto&&...Args){\
20055 return name(name,Args...);\
20060 #define lambda_with_catch(...) [__VA_ARGS__]
20062 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
20064 #define lambda_RLSRRS _my_jb_super_sb_name_
20072 #define elseif else if
20074 #define _big_than_ >
20076 #define _small_than_ <
20078 #if defined(_MSC_VER)
20085 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
20087 #define BREAK_NAMESPACE }
20090 #define template_name template
20092 #define type_name class
20094 #if defined(DEBUG) || defined(_DEBUG)
20095 #define not_in_debug 0
20097 #define not_in_debug 1
20101 #define ec(ch) U ## ch
20103 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
20104 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
20106 #define ELC_TEST_EVENTNAME(name)
20109 #define override_instance_struct \
20111 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
20112 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
20113 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
20114 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
20115 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
20117 #if defined(_WIN32)
20118 #define distinctive __declspec(dllexport)
20120 #define distinctive
20123 #if defined(_WIN32)
20124 #define force_inline __forceinline
20125 #elif defined(__GNUC__)
20126 #define force_inline __attribute__((always_inline)) inline
20128 #define force_inline inline
20131 #if defined(_WIN32)
20132 #define with_no_vtable __declspec(novtable)
20134 #define with_no_vtable
20137 #define in_consteval (::std::is_constant_evaluated())
20139 #define no_vtable_struct struct with_no_vtable
20140 #define no_vtable_class class with_no_vtable
20144 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
20148 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20150 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/defs.hpp"
20162 struct base_numerical_representation_t{};
20166 class numerical_representation_t:
public base_numerical_representation_t{
20168 string _radix_table=es
"0123456789"_constexpr_str;
20169 char_t _fractional_sign=ec(
'.');
20170 char_t _positive_sign=ec(
'+');
20171 char_t _negative_sign=ec(
'-');
20172 string _nan=es
"NaN"_constexpr_str;
20173 string _signaling_nan=es
"signaling_NaN"_constexpr_str;
20174 string _quiet_nan=es
"quiet_NaN"_constexpr_str;
20175 string _inf=es
"Inf"_constexpr_str;
20176 char_t _unknown_data_start_sign=ec(
'[');
20177 char_t _unknown_data_split_sign=ec(
',');
20178 char_t _unknown_data_end_sign=ec(
']');
20180 numerical_representation_t()noexcept=default;
20181 numerical_representation_t(const numerical_representation_t&)noexcept=default;
20182 numerical_representation_t(numerical_representation_t&&)noexcept=default;
20183 numerical_representation_t(
size_t radix,
string radix_table,
20184 char_t fractional_sign,
20185 char_t positive_sign,char_t negative_sign,
20186 string nan,
string signaling_nan,
string quiet_nan,
20188 char_t unknown_data_start_sign,char_t unknown_data_split_sign,char_t unknown_data_end_sign
20190 _radix(radix),_radix_table(radix_table),
20191 _fractional_sign(fractional_sign),
20192 _positive_sign(positive_sign),_negative_sign(negative_sign),
20193 _nan(nan),_signaling_nan(signaling_nan),_quiet_nan(quiet_nan),
20195 _unknown_data_start_sign(unknown_data_start_sign),_unknown_data_split_sign(unknown_data_split_sign),_unknown_data_end_sign(unknown_data_end_sign)
20197 numerical_representation_t(
size_t radix,
string radix_table)
noexcept:
20199 _radix_table(radix_table)
20202 void set_radix(
size_t radix)
noexcept{
20205 void set_radix_table(
string radix_table)
noexcept{
20206 _radix_table=radix_table;
20207 _radix=radix_table.size();
20209 void set_fractional_sign(char_t point)
noexcept{
20210 _fractional_sign=point;
20212 void set_positive_sign(char_t positive_sign)
noexcept{
20213 _positive_sign=positive_sign;
20215 void set_negative_sign(char_t negative_sign)
noexcept{
20216 _negative_sign=negative_sign;
20218 void set_nan(
string nan)
noexcept{
20221 void set_inf(
string inf)
noexcept{
20224 [[nodiscard]]
constexpr size_t radix()const noexcept{
20227 [[nodiscard]]
string radix_table()const noexcept{
20228 return _radix_table;
20230 [[nodiscard]]
constexpr char_t fractional_sign()const noexcept{
20231 return _fractional_sign;
20233 [[nodiscard]]
constexpr char_t positive_sign()const noexcept{
20234 return _positive_sign;
20236 [[nodiscard]]
constexpr char_t negative_sign()const noexcept{
20237 return _negative_sign;
20239 [[nodiscard]]
string nan()const noexcept{
20242 [[nodiscard]]
string inf()const noexcept{
20247 inline size_t get_info_tail_size_per_byte()const noexcept{
20248 constexpr auto info_threshold_base = pow(BIT_POSSIBILITY, bitnum_of(
byte));
20249 const auto info_threshold = to_size_t(ceil(log(info_threshold_base, _radix)));
20250 return info_threshold;
20252 template<
typename T>
20253 inline size_t get_info_tail_size()const noexcept{
20254 return get_info_tail_size_per_byte()*
sizeof(T);
20256 template<
typename T>
20257 inline string get_info_tail(T x)
const noexcept{
20258 auto info_tail_size_per_byte = get_info_tail_size_per_byte();
20260 data_view<const T> view{&x};
20261 for(
const byte c: view){
20262 auto s= to_string_rough((
unsigned char)c);
20263 aret+=
string{info_tail_size_per_byte-s.size(),_radix_table[0]}+s;
20267 template<
typename T>
20268 inline T get_from_info_tail(
string str)
const noexcept{
20269 const auto info_tail_size_per_byte = get_info_tail_size_per_byte();
20271 data_view<T> view{&aret};
20273 auto s=str.substr(0,info_tail_size_per_byte);
20274 c=(byte)from_string_get<unsigned char>(s);
20275 str=str.substr(info_tail_size_per_byte);
20279 template<
typename T>
20280 inline string to_string_num_base(T num)
const noexcept{
20281 if constexpr(::std::is_floating_point_v<T>){
20283 suppress_msvc_warning(26494)
20284 size_t order_of_magnitude;
20286 order_of_magnitude = to_size_t(floor(log(num,_radix)+1));
20288 order_of_magnitude = 0;
20289 aret=_radix_table[0];
20290 aret+=_fractional_sign;
20292 num/=pow(_radix,order_of_magnitude);
20294 aret=_radix_table[to_size_t(num)];
20299 constinit auto info_threshold_base = pow(BIT_POSSIBILITY,bitnum_of(T));
20300 auto info_threshold = to_size_t(ceil(log(info_threshold_base,_radix)));
20302 bool is_mantissa_begined =
false;
20306 T first_char_index;
20307 num=::std::modf(num,&first_char_index);
20308 aret+=_radix_table[to_size_t(first_char_index)];
20310 if(to_size_t(first_char_index))
20311 is_mantissa_begined =
true;
20312 if(is_mantissa_begined){
20317 if(order_of_magnitude){
20318 if(!--order_of_magnitude)
20319 aret+=_fractional_sign;
20322 if(!info_threshold && !order_of_magnitude)
20325 if(order_of_magnitude)
20326 aret.append(order_of_magnitude,_radix_table[0]);
20327 if(aret.ends_with(_fractional_sign))
20334 const auto first_char_index = mod(num,_radix);
20336 aret.push_front(_radix_table[(
size_t)first_char_index]);
20341 template<
typename T>
20342 inline bool to_string_special_value_check(T num,
string&str,
bool is_negative)
const noexcept{
20343 if constexpr(::std::numeric_limits<T>::has_signaling_NaN || ::std::numeric_limits<T>::has_quiet_NaN){
20344 if(::std::isnan(num)){
20345 if constexpr(::std::numeric_limits<T>::has_signaling_NaN){
20346 constexpr auto signaling_NaN = ::std::numeric_limits<T>::signaling_NaN();
20347 if(full_equal_in_byte(signaling_NaN,num)){
20348 str=_signaling_nan;
20351 auto negative_signaling_NaN = copy_as_negative(signaling_NaN);
20352 if(full_equal_in_byte(negative_signaling_NaN,num)){
20353 str=_negative_sign+_signaling_nan;
20357 if constexpr(::std::numeric_limits<T>::has_quiet_NaN){
20358 constexpr auto quiet_NaN = ::std::numeric_limits<T>::quiet_NaN();
20359 if(full_equal_in_byte(quiet_NaN,num)){
20363 auto negative_quiet_NaN = copy_as_negative(quiet_NaN);
20364 if(full_equal_in_byte(negative_quiet_NaN,num)){
20365 str=_negative_sign+_quiet_nan;
20369 str=_nan+_unknown_data_start_sign;
20370 data_view<T> view{&num};
20371 for(
const byte c: view){
20372 str += to_string_rough((
unsigned char)c);
20373 str += _unknown_data_split_sign;
20375 str.back() = _unknown_data_end_sign;
20379 if constexpr(::std::numeric_limits<T>::has_infinity){
20380 if(::std::isinf(num)){
20381 if constexpr(!::std::is_unsigned_v<T>)
20383 str=_negative_sign+_inf;
20392 template<
typename T> requires ::std::is_arithmetic_v<T>
20393 inline string to_string_rough_no_special_value_check(T num)
const noexcept{
20395 const bool is_negative=magic_number::is_negative(num);
20396 typedef decltype(lambda{
20397 if constexpr(::std::is_unsigned_v<T>||::std::is_floating_point_v<T>)
20400 return::std::make_unsigned_t<T>();
20404 if constexpr(!::std::is_unsigned_v<T>)
20406 aret=_negative_sign;
20409 aret+=to_string_num_base(unum);
20413 template<
typename T> requires ::std::is_arithmetic_v<T>
20414 inline string to_string_rough(T num)
const noexcept{
20416 const bool is_negative=magic_number::is_negative(num);
20417 if(to_string_special_value_check(num,aret,is_negative))
20419 return to_string_rough_no_special_value_check(num);
20422 template<
typename T>
20423 inline T from_string_get_num_base(
string str)
const noexcept{
20424 if constexpr(::std::is_floating_point_v<T>){
20425 size_t order_of_magnitude = str.size();
20427 size_t i=str.size();
20430 const size_t index=_radix_table.find(str[i]);
20431 if(index==string::npos){
20432 if(str[i] == _fractional_sign){
20433 order_of_magnitude=i;
20441 aret*=pow(_radix, order_of_magnitude);
20446 for(
size_t i = 0; i < str.size(); i++){
20447 const size_t index = _radix_table.find(str[i]);
20448 if(index == string::npos)
20456 template<
typename T>
20457 inline bool from_string_special_value_check(
string str,T& num,
bool is_negative)
const noexcept{
20458 if constexpr(::std::numeric_limits<T>::has_signaling_NaN || ::std::numeric_limits<T>::has_quiet_NaN){
20459 if constexpr(::std::numeric_limits<T>::has_signaling_NaN)
20460 if(str==_signaling_nan){
20461 num= copy_as_negative(::std::numeric_limits<T>::signaling_NaN(),is_negative);
20464 if constexpr(::std::numeric_limits<T>::has_quiet_NaN)
20465 if(str==_quiet_nan){
20466 num= copy_as_negative(::std::numeric_limits<T>::quiet_NaN(),is_negative);
20469 if(str.starts_with(_nan+_unknown_data_start_sign)){
20470 str.pop_front(_nan.size()+1);
20472 suppress_msvc_warning(26494)
20473 data_block<T> block;
20474 size_t write_index = 0;
20476 const size_t dot_pos = str.find(_unknown_data_split_sign);
20477 auto byte_str = str.substr(0, dot_pos);
20478 block[write_index++] = (byte)from_string_get<unsigned char>(byte_str);
20479 if(dot_pos == string::npos)
20481 str = str.substr(dot_pos+1);
20483 num= data_cast<T>(block);
20486 elseif(str == _nan){
20487 if constexpr(::std::numeric_limits<T>::has_quiet_NaN)
20488 num= copy_as_negative(::std::numeric_limits<T>::quiet_NaN(),is_negative);
20490 num= copy_as_negative(::std::numeric_limits<T>::signaling_NaN(),is_negative);
20494 if constexpr(::std::numeric_limits<T>::has_infinity){
20497 return copy_as_negative(::std::numeric_limits<T>::infinity());
20499 return ::std::numeric_limits<T>::infinity();
20506 template<
typename T> requires ::std::is_arithmetic_v<T>
20507 inline T from_string_get(
string str)
const noexcept{
20509 if constexpr(::std::is_floating_point_v<T>){
20510 const auto info_tail_size=get_info_tail_size<T>();
20511 if(str.size()>info_tail_size){
20512 const auto tail_pos=str.size()-info_tail_size;
20513 auto info_tail=str.substr(tail_pos);
20514 auto str_with_out_tail=str.substr(0,tail_pos);
20515 if(str_with_out_tail.back()==_fractional_sign)
20516 str_with_out_tail.pop_back();
20517 auto num=get_from_info_tail<T>(info_tail);
20518 if(to_string_rough(num)==str_with_out_tail)
20520 str_with_out_tail+=
string{info_tail.size(),_radix_table[0]};
20521 if(to_string_rough(num)==str_with_out_tail)
20526 suppress_msvc_warning(26496);
20527 bool is_negative=
false;
20528 if constexpr(!::std::is_unsigned_v<T>)
20529 if(str[0]==_negative_sign){
20533 if(str[0]==_positive_sign)
20535 if(from_string_special_value_check(str,num,is_negative))
20537 typedef decltype(lambda{
20538 if constexpr(::std::is_unsigned_v<T>||::std::is_floating_point_v<T>)
20541 return::std::make_unsigned_t<T>();
20543 UT unum=from_string_get_num_base<UT>(str);
20544 return copy_as_negative<T>(unum,is_negative);
20546 template<typename T> requires ::std::is_arithmetic_v<T>
20547 inline
string to_string(T num)const noexcept{
20549 if(to_string_special_value_check(num,aret,is_negative(num)))
20551 aret=to_string_rough_no_special_value_check(num);
20552 if constexpr(::std::is_floating_point_v<T>){
20554 auto rounding_up_char = lambda_with_catch(&) (string::arec_t char_arc)
noexcept{
20555 const char_t up_char = move(char_arc);
20556 size_t up_pos = _radix_table.find(up_char);
20558 if(up_pos == _radix)
20560 move(char_arc) = _radix_table[up_pos];
20561 return up_pos == 0;
20563 auto rounding_up = lambda_with_catch(&) (
string&str)
noexcept{
20564 size_t i = str.size();
20566 if(rounding_up_char(str[i])){
20568 if(str[i] == _fractional_sign)
20572 str.push_front(_radix_table[1]);
20579 size_t dot_pos=aret.find(_fractional_sign);
20581 if(from_string_get<T>(aret) != num){
20583 string info_tail=get_info_tail(num);
20584 if(dot_pos==string::npos){
20585 if(aret.ends_with(
string{info_tail.size(),_radix_table[0]}))
20586 aret.pop_back(info_tail.size());
20588 aret.push_back(_fractional_sign);
20595 size_t left_pos = 0;
20596 size_t right_pos = aret.size();
20597 string better_aret,better_aret_last;
20598 if(dot_pos==string::npos)
20599 dot_pos=aret.size();
20601 size_t step_pos = (left_pos + right_pos) / 2;
20602 better_aret = aret.substr(0, step_pos);
20603 if(step_pos==dot_pos)
20606 const char_t cut_char = aret[step_pos];
20607 const size_t cut_num = _radix_table.find(cut_char);
20608 if(cut_num >= _radix / 2)
20609 rounding_up(better_aret);
20610 if(better_aret.size() < dot_pos)
20611 better_aret.resize(dot_pos,_radix_table[0]);
20613 if(from_string_get<T>(better_aret) == num){
20614 if(better_aret.back() == _radix_table[0]){
20615 const auto end_pos = max(better_aret.find_last_not_of(_radix_table[0])+1, dot_pos);
20616 better_aret.resize(end_pos);
20617 if(better_aret.back() == _fractional_sign)
20618 better_aret.pop_back();
20620 right_pos = min(better_aret.size(), step_pos);
20621 better_aret_last = better_aret;
20623 elseif(left_pos != step_pos)
20624 left_pos = step_pos;
20627 }
while(left_pos < right_pos);
20628 if(better_aret_last){
20629 aret = better_aret_last;
20630 if(aret.ends_with(_fractional_sign))
20638 push_and_disable_msvc_warning(26426);
20639 distinctive
inline numerical_representation_t trinary{3,es
"012"_constexpr_str};
20640 distinctive
inline numerical_representation_t binary{2,es
"01"_constexpr_str};
20641 distinctive
inline numerical_representation_t octal{8,es
"01234567"_constexpr_str};
20642 distinctive
inline numerical_representation_t decimal{10,es
"0123456789"_constexpr_str};
20643 distinctive
inline numerical_representation_t hexadecimal{16,es
"0123456789abcdef"_constexpr_str};
20644 distinctive
inline numerical_representation_t hexadecimal_upper{16,es
"0123456789ABCDEF"_constexpr_str};
20645 pop_msvc_warning();
20648 template<
typename T> requires ::std::is_arithmetic_v<T>
20649 inline T from_string_get(
const string&str,
const numerical_representation_t&radix=decimal)
noexcept{
20650 return radix.from_string_get<T>(str);
20653 template<
typename T> requires ::std::is_arithmetic_v<T>
20654 inline string to_string_rough(T num,
const numerical_representation_t&radix=decimal)
noexcept{
20655 return radix.to_string_rough(num);
20658 template<
typename T> requires ::std::is_arithmetic_v<T>
20659 inline string to_string(T num,
const numerical_representation_t&radix=decimal)
noexcept{
20660 return radix.to_string(num);
20665 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20666 #if defined(ELC_TEST_ON)
20667 namespace numerical_representation_part_test{
20668 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_test.hpp"
20676 inline void test(){
20677 ELC_TEST_EVENTNAME(
"numerical_representation部分测试");
20679 inline void test_log_out(){
20681 inline void test_end(){
20686 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20690 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
20698 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
20709 #if defined(_MSC_VER)
20710 #pragma warning(pop)
20712 #undef suppress_msvc_warning
20713 #undef disable_msvc_warning
20714 #undef push_msvc_warning
20715 #undef pop_msvc_warning
20716 #undef push_and_disable_msvc_warning
20719 #undef BIT_POSSIBILITY
20721 #if defined(ELC_VOID_NAME)
20722 #define void the_void
20727 #undef noexcept_as_auto
20728 #undef constexpr_as
20729 #undef constexpr_as_auto
20731 #undef using_method_from_base_t
20732 #undef using_method_from_value
20737 #undef re_declvalue
20742 #undef template_error
20743 #undef template_warning
20745 #undef type_info_of
20746 #undef type_name_of
20748 #undef is_common_attribute
20749 #undef is_special_attribute
20751 #undef has_attribute
20752 #undef not_has_attribute
20754 #undef float_size_of
20757 #undef def_common_attribute_with_nothing
20758 #undef def_special_attribute_with_nothing
20760 #undef common_attribute_t
20761 #undef special_attribute_t
20764 #undef enabled_by_default
20765 #undef disabled_by_default
20766 #undef enable_if_not_ill_form
20769 #undef was_an_ill_form
20770 #undef was_an_ill_form_with_parameter
20771 #undef was_not_an_ill_form
20772 #undef was_not_an_ill_form_and_noexcept
20773 #undef was_not_an_ill_form_with_parameter
20775 #undef recursive_lambda
20776 #undef get_recursive_lambda_caller
20778 #undef lambda_with_catch
20779 #undef self_recursion
20780 #undef lambda_RLSRRS
20788 #undef _small_than_
20790 #if defined(_MSC_VER)
20796 #undef INTER_NAMESPACE
20797 #undef BREAK_NAMESPACE
20802 #undef template_name
20805 #undef not_in_debug
20810 #undef ELC_TEST_EVENTNAME
20812 #undef override_instance_struct
20816 #undef force_inline
20818 #undef with_no_vtable
20820 #undef in_consteval
20822 #undef no_vtable_struct
20823 #undef no_vtable_class
20827 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
20831 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20834 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_export.hpp"
20843 #define export using defs::
20845 export to_string_rough;
20846 export from_string_get;
20851 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/numerical_representation/_body.hpp"
20856 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
20861 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
20863 #error ERROR_MSG_UNABLE_OS
20865 namespace elc::APIs::library_load{
20866 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
20878 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
20880 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
20891 #define BIT_POSSIBILITY 2
20895 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
20897 #if defined(_MSC_VER)
20898 #pragma warning(push,ELC_WARNING_LEVEL)
20899 #pragma warning(disable:4099)
20900 #pragma warning(disable:26812)
20901 #pragma warning(disable:4584)
20902 #pragma warning(disable:4250)
20903 #pragma warning(disable:26432)
20904 #pragma warning(disable:26435)
20905 #pragma warning(disable:26481)
20906 #pragma warning(disable:26446)
20907 #pragma warning(disable:26434)
20908 #pragma warning(disable:26429)
20909 #pragma warning(disable:26471)
20910 #pragma warning(disable:26474)
20911 #pragma warning(disable:26473)
20912 #pragma warning(disable:26456)
20913 #pragma warning(disable:26485)
20914 #pragma warning(disable:26490)
20915 #pragma warning(disable:26472)
20916 #pragma warning(disable:26482)
20917 #pragma warning(disable:26493)
20919 #if defined(_MSC_VER)
20920 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
20921 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
20922 #define push_msvc_warning() __pragma(warning(push))
20923 #define pop_msvc_warning() __pragma(warning(pop))
20924 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
20926 #define suppress_msvc_warning(...)
20927 #define disable_msvc_warning(...)
20928 #define push_msvc_warning()
20929 #define pop_msvc_warning()
20930 #define push_and_disable_msvc_warning(...)
20933 #if defined(ELC_VOID_NAME)
20938 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
20939 #define noexcept_as_auto MAGIC
20940 #define constexpr_as(...) MAGIC constexpr
20941 #define constexpr_as_auto MAGIC MAGIC constexpr
20943 #define using_method_from_base_t(name,...) \
20944 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
20945 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
20947 return base_t::name(forward<Args>(rest)...);\
20950 #define using_method_from_value(name,value_name,...) \
20951 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
20952 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
20954 return value_name.name(forward<Args>(rest)...);\
20957 #define floop while(__builtin_is_my_dick_still_there())
20958 #define enable_adl(name) void name()noexcept=delete
20960 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
20961 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
20963 #define declvalue(...) (::std::declval<__VA_ARGS__>())
20966 #define template_error(reason) static_assert(template_error_helper<T>,reason)
20968 #define template_warning(reason) template_warning_helper<T>(reason)
20971 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
20972 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
20974 #define is_common_attribute(name) public attribute<T,name<T>>
20975 #define is_special_attribute(name) public attribute<T,name>
20977 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
20978 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
20981 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
20983 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
20986 #define def_common_attribute_with_nothing(name) \
20987 template<typename T>\
20990 #define def_special_attribute_with_nothing(name) \
20993 #define common_attribute_t template<class>class
20994 #define special_attribute_t class
21004 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
21006 #define enabled_by_default class enable_state=void
21008 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
21010 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
21012 #define enable_flag class enable_state
21014 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
21015 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
21016 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
21017 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
21018 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
21021 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
21023 #define get_recursive_lambda_caller(name) \
21024 lambda_with_catch(&)(auto&&...Args){\
21025 return name(name,Args...);\
21030 #define lambda_with_catch(...) [__VA_ARGS__]
21032 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
21034 #define lambda_RLSRRS _my_jb_super_sb_name_
21042 #define elseif else if
21044 #define _big_than_ >
21046 #define _small_than_ <
21048 #if defined(_MSC_VER)
21055 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
21057 #define BREAK_NAMESPACE }
21060 #define template_name template
21062 #define type_name class
21064 #if defined(DEBUG) || defined(_DEBUG)
21065 #define not_in_debug 0
21067 #define not_in_debug 1
21071 #define ec(ch) U ## ch
21073 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
21074 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
21076 #define ELC_TEST_EVENTNAME(name)
21079 #define override_instance_struct \
21081 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
21082 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
21083 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
21084 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
21085 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
21087 #if defined(_WIN32)
21088 #define distinctive __declspec(dllexport)
21090 #define distinctive
21093 #if defined(_WIN32)
21094 #define force_inline __forceinline
21095 #elif defined(__GNUC__)
21096 #define force_inline __attribute__((always_inline)) inline
21098 #define force_inline inline
21101 #if defined(_WIN32)
21102 #define with_no_vtable __declspec(novtable)
21104 #define with_no_vtable
21107 #define in_consteval (::std::is_constant_evaluated())
21109 #define no_vtable_struct struct with_no_vtable
21110 #define no_vtable_class class with_no_vtable
21114 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
21116 using namespace ::elc::defs;
21119 #if SYSTEM_TYPE == linux
21121 #elif SYSTEM_TYPE == windows
21126 [[nodiscard]]
inline library_handle base_load_library(
const char*file_name)
noexcept{
21129 #if SYSTEM_TYPE == linux
21130 dlopen(file_name,RTLD_LAZY)
21131 #elif SYSTEM_TYPE == windows
21132 LoadLibraryA((LPCSTR)file_name)
21136 [[nodiscard]]
inline string base_get_load_error()noexcept{
21138 #if SYSTEM_TYPE == linux
21139 to_char_t_str(dlerror());
21140 #elif SYSTEM_TYPE == windows
21141 es
"ERROR CODE:"_constexpr_str+to_string((DWORD)GetLastError());
21145 inline void base_free_library(library_handle handle)
noexcept{
21146 #if SYSTEM_TYPE == linux
21148 #elif SYSTEM_TYPE == windows
21149 FreeLibrary(handle)
21153 [[nodiscard]]
inline void* base_get_symbol(library_handle handle,
const char*symbol_name)
noexcept{
21156 #if SYSTEM_TYPE == linux
21157 dlsym(handle,symbol_name)
21158 #elif SYSTEM_TYPE == windows
21159 (
void*)GetProcAddress(handle,(LPCSTR)symbol_name)
21164 [[nodiscard]]
inline library_handle load_library(
string file_name)
noexcept{
21166 return base_load_library(to_char_str(file_name).c_str());
21168 [[nodiscard]]
inline string get_load_error()noexcept{
21169 return base_get_load_error();
21171 inline void free_library(library_handle handle)
noexcept{
21172 return base_free_library(handle);
21174 [[nodiscard]]
inline void* get_symbol(library_handle handle,
string symbol_name)
noexcept{
21176 return base_get_symbol(handle,to_char_str(symbol_name).c_str());
21179 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
21190 #if defined(_MSC_VER)
21191 #pragma warning(pop)
21193 #undef suppress_msvc_warning
21194 #undef disable_msvc_warning
21195 #undef push_msvc_warning
21196 #undef pop_msvc_warning
21197 #undef push_and_disable_msvc_warning
21200 #undef BIT_POSSIBILITY
21202 #if defined(ELC_VOID_NAME)
21203 #define void the_void
21208 #undef noexcept_as_auto
21209 #undef constexpr_as
21210 #undef constexpr_as_auto
21212 #undef using_method_from_base_t
21213 #undef using_method_from_value
21218 #undef re_declvalue
21223 #undef template_error
21224 #undef template_warning
21226 #undef type_info_of
21227 #undef type_name_of
21229 #undef is_common_attribute
21230 #undef is_special_attribute
21232 #undef has_attribute
21233 #undef not_has_attribute
21235 #undef float_size_of
21238 #undef def_common_attribute_with_nothing
21239 #undef def_special_attribute_with_nothing
21241 #undef common_attribute_t
21242 #undef special_attribute_t
21245 #undef enabled_by_default
21246 #undef disabled_by_default
21247 #undef enable_if_not_ill_form
21250 #undef was_an_ill_form
21251 #undef was_an_ill_form_with_parameter
21252 #undef was_not_an_ill_form
21253 #undef was_not_an_ill_form_and_noexcept
21254 #undef was_not_an_ill_form_with_parameter
21256 #undef recursive_lambda
21257 #undef get_recursive_lambda_caller
21259 #undef lambda_with_catch
21260 #undef self_recursion
21261 #undef lambda_RLSRRS
21269 #undef _small_than_
21271 #if defined(_MSC_VER)
21277 #undef INTER_NAMESPACE
21278 #undef BREAK_NAMESPACE
21283 #undef template_name
21286 #undef not_in_debug
21291 #undef ELC_TEST_EVENTNAME
21293 #undef override_instance_struct
21297 #undef force_inline
21299 #undef with_no_vtable
21301 #undef in_consteval
21303 #undef no_vtable_struct
21304 #undef no_vtable_class
21308 #line 94 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
21310 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/undef_decl_system_type.hpp"
21323 #undef ERROR_MSG_UNABLE_OS
21327 #line 96 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/library_load.hpp"
21332 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21335 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
21348 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
21352 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21353 namespace elc::defs{
21354 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
21362 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21374 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21376 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
21387 #define BIT_POSSIBILITY 2
21391 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21393 #if defined(_MSC_VER)
21394 #pragma warning(push,ELC_WARNING_LEVEL)
21395 #pragma warning(disable:4099)
21396 #pragma warning(disable:26812)
21397 #pragma warning(disable:4584)
21398 #pragma warning(disable:4250)
21399 #pragma warning(disable:26432)
21400 #pragma warning(disable:26435)
21401 #pragma warning(disable:26481)
21402 #pragma warning(disable:26446)
21403 #pragma warning(disable:26434)
21404 #pragma warning(disable:26429)
21405 #pragma warning(disable:26471)
21406 #pragma warning(disable:26474)
21407 #pragma warning(disable:26473)
21408 #pragma warning(disable:26456)
21409 #pragma warning(disable:26485)
21410 #pragma warning(disable:26490)
21411 #pragma warning(disable:26472)
21412 #pragma warning(disable:26482)
21413 #pragma warning(disable:26493)
21415 #if defined(_MSC_VER)
21416 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
21417 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
21418 #define push_msvc_warning() __pragma(warning(push))
21419 #define pop_msvc_warning() __pragma(warning(pop))
21420 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
21422 #define suppress_msvc_warning(...)
21423 #define disable_msvc_warning(...)
21424 #define push_msvc_warning()
21425 #define pop_msvc_warning()
21426 #define push_and_disable_msvc_warning(...)
21429 #if defined(ELC_VOID_NAME)
21434 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
21435 #define noexcept_as_auto MAGIC
21436 #define constexpr_as(...) MAGIC constexpr
21437 #define constexpr_as_auto MAGIC MAGIC constexpr
21439 #define using_method_from_base_t(name,...) \
21440 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
21441 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
21443 return base_t::name(forward<Args>(rest)...);\
21446 #define using_method_from_value(name,value_name,...) \
21447 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
21448 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
21450 return value_name.name(forward<Args>(rest)...);\
21453 #define floop while(__builtin_is_my_dick_still_there())
21454 #define enable_adl(name) void name()noexcept=delete
21456 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
21457 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
21459 #define declvalue(...) (::std::declval<__VA_ARGS__>())
21462 #define template_error(reason) static_assert(template_error_helper<T>,reason)
21464 #define template_warning(reason) template_warning_helper<T>(reason)
21467 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
21468 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
21470 #define is_common_attribute(name) public attribute<T,name<T>>
21471 #define is_special_attribute(name) public attribute<T,name>
21473 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
21474 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
21477 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
21479 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
21482 #define def_common_attribute_with_nothing(name) \
21483 template<typename T>\
21486 #define def_special_attribute_with_nothing(name) \
21489 #define common_attribute_t template<class>class
21490 #define special_attribute_t class
21500 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
21502 #define enabled_by_default class enable_state=void
21504 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
21506 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
21508 #define enable_flag class enable_state
21510 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
21511 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
21512 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
21513 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
21514 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
21517 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
21519 #define get_recursive_lambda_caller(name) \
21520 lambda_with_catch(&)(auto&&...Args){\
21521 return name(name,Args...);\
21526 #define lambda_with_catch(...) [__VA_ARGS__]
21528 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
21530 #define lambda_RLSRRS _my_jb_super_sb_name_
21538 #define elseif else if
21540 #define _big_than_ >
21542 #define _small_than_ <
21544 #if defined(_MSC_VER)
21551 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
21553 #define BREAK_NAMESPACE }
21556 #define template_name template
21558 #define type_name class
21560 #if defined(DEBUG) || defined(_DEBUG)
21561 #define not_in_debug 0
21563 #define not_in_debug 1
21567 #define ec(ch) U ## ch
21569 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
21570 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
21572 #define ELC_TEST_EVENTNAME(name)
21575 #define override_instance_struct \
21577 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
21578 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
21579 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
21580 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
21581 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
21583 #if defined(_WIN32)
21584 #define distinctive __declspec(dllexport)
21586 #define distinctive
21589 #if defined(_WIN32)
21590 #define force_inline __forceinline
21591 #elif defined(__GNUC__)
21592 #define force_inline __attribute__((always_inline)) inline
21594 #define force_inline inline
21597 #if defined(_WIN32)
21598 #define with_no_vtable __declspec(novtable)
21600 #define with_no_vtable
21603 #define in_consteval (::std::is_constant_evaluated())
21605 #define no_vtable_struct struct with_no_vtable
21606 #define no_vtable_class class with_no_vtable
21610 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
21614 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21616 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/lib_loader.hpp"
21625 namespace lib_loader_n{
21626 using namespace ::elc::APIs::library_load;
21628 struct library_info_t;
21629 typedef comn_ptr_t<library_info_t> library_handle_t;
21639 _m=library_handle{0};
21640 _error=locale::str::lib_load::null_lib;
21641 attribute_ptr_cast<ref_able>(
this)->init_never_ref_num_zero();
21645 _m=load_library(lib_name);
21648 _error=get_load_error();
21653 [[nodiscard]]
explicit operator bool()
const noexcept{
21656 [[nodiscard]]
string get_error()
noexcept{
21659 [[nodiscard]]
string get_name()
noexcept{
21663 [[nodiscard]]
void*get_symbol(
string symbol_name)
noexcept{
21664 return APIs::library_load::get_symbol(_m,symbol_name);
21666 template<
class symbol_t>
21667 [[nodiscard]]
symbol_t&get_symbol_as(
string symbol_name)
noexcept{
21668 return*
reinterpret_cast<symbol_t*
>(get_symbol(symbol_name));
21670 template<
class Func_t>
21671 [[nodiscard]]function_t<Func_t>get_symbol_as_function(
string symbol_name)
noexcept;
21673 [[nodiscard]]
inline bool the_pointer_to_bool(
const library_info_t*a)
noexcept{
21674 return a->operator bool();
21676 distinctive
inline library_info_t null_lib{special_init};
21677 [[nodiscard]]
inline constexpr library_info_t*the_get_null_ptr(
const library_info_t*)
noexcept{
return&null_lib;}
21685 library_handle_t _lib;
21693 template<
class Func_t>
21695 #if !defined(_MSC_VER)
21696 template<
class Ret_t,
class...Args_t,
bool nothrow>
21698 symbol_t(library_handle_t lib,
string symbol_name,Ret_t(*self)(Args_t...)noexcept(nothrow))
noexcept:
21703 template<
class Ret_t,
class...Args_t>
21705 symbol_t(library_handle_t lib,
string symbol_name,Ret_t(*self)(Args_t...))noexcept:
21708 template<
class Ret_t,
class...Args_t>
21709 struct symbol_t<Ret_t(Args_t...)noexcept>:function_data_warpper_t<Ret_t(*)(Args_t...)noexcept>,base_symbol_t{
21710 symbol_t(library_handle_t lib,
string symbol_name,Ret_t(*self)(Args_t...)noexcept)noexcept:
21711 function_data_warpper_t<Ret_t(*)(Args_t...)noexcept>(self),base_symbol_t(lib,symbol_name){}
21715 template<
class Func_t>
21716 [[nodiscard]]
inline function_t<Func_t>library_info_t::get_symbol_as_function(
string symbol_name)
noexcept{
21717 auto func_p=&get_symbol_as<Func_t>(symbol_name);
21721 return symbol_t<Func_t>(
this,symbol_name,func_p);
21724 [[nodiscard]]
inline library_handle_t load_lib(
string lib_name)
noexcept{
21725 return get<library_info_t>(lib_name);
21727 template<
class Func_t>
21728 [[nodiscard]]
inline library_handle_t get_library_handle_form_symbol(function_t<Func_t> symbol)
noexcept{
21729 auto symbol_info=symbol.get_as<base_symbol_t>();
21730 if(symbol_info.fail())
21733 return symbol_info.get_ref()._lib;
21735 template<
class Func_t>
21736 [[nodiscard]]
inline string get_symbol_name_form_symbol(function_t<Func_t> symbol)
noexcept{
21737 auto symbol_info=symbol.get_as<base_symbol_t>();
21738 if(symbol_info.fail())
21741 return symbol_info.get_ref()._name;
21747 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21748 #if defined(ELC_TEST_ON)
21749 namespace lib_loader_part_test{
21750 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_test.hpp"
21758 inline void test(){
21759 ELC_TEST_EVENTNAME(
"lib_loader部分测试");
21761 inline void test_log_out(){}
21762 inline void test_end{}
21766 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21770 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
21778 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
21789 #if defined(_MSC_VER)
21790 #pragma warning(pop)
21792 #undef suppress_msvc_warning
21793 #undef disable_msvc_warning
21794 #undef push_msvc_warning
21795 #undef pop_msvc_warning
21796 #undef push_and_disable_msvc_warning
21799 #undef BIT_POSSIBILITY
21801 #if defined(ELC_VOID_NAME)
21802 #define void the_void
21807 #undef noexcept_as_auto
21808 #undef constexpr_as
21809 #undef constexpr_as_auto
21811 #undef using_method_from_base_t
21812 #undef using_method_from_value
21817 #undef re_declvalue
21822 #undef template_error
21823 #undef template_warning
21825 #undef type_info_of
21826 #undef type_name_of
21828 #undef is_common_attribute
21829 #undef is_special_attribute
21831 #undef has_attribute
21832 #undef not_has_attribute
21834 #undef float_size_of
21837 #undef def_common_attribute_with_nothing
21838 #undef def_special_attribute_with_nothing
21840 #undef common_attribute_t
21841 #undef special_attribute_t
21844 #undef enabled_by_default
21845 #undef disabled_by_default
21846 #undef enable_if_not_ill_form
21849 #undef was_an_ill_form
21850 #undef was_an_ill_form_with_parameter
21851 #undef was_not_an_ill_form
21852 #undef was_not_an_ill_form_and_noexcept
21853 #undef was_not_an_ill_form_with_parameter
21855 #undef recursive_lambda
21856 #undef get_recursive_lambda_caller
21858 #undef lambda_with_catch
21859 #undef self_recursion
21860 #undef lambda_RLSRRS
21868 #undef _small_than_
21870 #if defined(_MSC_VER)
21876 #undef INTER_NAMESPACE
21877 #undef BREAK_NAMESPACE
21882 #undef template_name
21885 #undef not_in_debug
21890 #undef ELC_TEST_EVENTNAME
21892 #undef override_instance_struct
21896 #undef force_inline
21898 #undef with_no_vtable
21900 #undef in_consteval
21902 #undef no_vtable_struct
21903 #undef no_vtable_class
21907 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
21911 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21914 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_export.hpp"
21923 #define export using defs::lib_loader_n::
21924 export library_handle_t;
21926 export get_library_handle_form_symbol;
21927 export get_symbol_name_form_symbol;
21932 #line 30 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/lib_loader/_body.hpp"
21937 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
21942 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
21943 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/literal"
21952 #if !defined(ELC_LITERAL)
21953 #define ELC_LITERAL
21954 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
21963 #if defined(ELC_TEST)
21964 #error "this part cannot be tested."
21966 namespace elc::defs{
21967 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
21975 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21987 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
21989 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
22000 #define BIT_POSSIBILITY 2
22004 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22006 #if defined(_MSC_VER)
22007 #pragma warning(push,ELC_WARNING_LEVEL)
22008 #pragma warning(disable:4099)
22009 #pragma warning(disable:26812)
22010 #pragma warning(disable:4584)
22011 #pragma warning(disable:4250)
22012 #pragma warning(disable:26432)
22013 #pragma warning(disable:26435)
22014 #pragma warning(disable:26481)
22015 #pragma warning(disable:26446)
22016 #pragma warning(disable:26434)
22017 #pragma warning(disable:26429)
22018 #pragma warning(disable:26471)
22019 #pragma warning(disable:26474)
22020 #pragma warning(disable:26473)
22021 #pragma warning(disable:26456)
22022 #pragma warning(disable:26485)
22023 #pragma warning(disable:26490)
22024 #pragma warning(disable:26472)
22025 #pragma warning(disable:26482)
22026 #pragma warning(disable:26493)
22028 #if defined(_MSC_VER)
22029 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
22030 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
22031 #define push_msvc_warning() __pragma(warning(push))
22032 #define pop_msvc_warning() __pragma(warning(pop))
22033 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
22035 #define suppress_msvc_warning(...)
22036 #define disable_msvc_warning(...)
22037 #define push_msvc_warning()
22038 #define pop_msvc_warning()
22039 #define push_and_disable_msvc_warning(...)
22042 #if defined(ELC_VOID_NAME)
22047 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
22048 #define noexcept_as_auto MAGIC
22049 #define constexpr_as(...) MAGIC constexpr
22050 #define constexpr_as_auto MAGIC MAGIC constexpr
22052 #define using_method_from_base_t(name,...) \
22053 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
22054 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
22056 return base_t::name(forward<Args>(rest)...);\
22059 #define using_method_from_value(name,value_name,...) \
22060 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
22061 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
22063 return value_name.name(forward<Args>(rest)...);\
22066 #define floop while(__builtin_is_my_dick_still_there())
22067 #define enable_adl(name) void name()noexcept=delete
22069 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
22070 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
22072 #define declvalue(...) (::std::declval<__VA_ARGS__>())
22075 #define template_error(reason) static_assert(template_error_helper<T>,reason)
22077 #define template_warning(reason) template_warning_helper<T>(reason)
22080 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
22081 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
22083 #define is_common_attribute(name) public attribute<T,name<T>>
22084 #define is_special_attribute(name) public attribute<T,name>
22086 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
22087 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
22090 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
22092 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
22095 #define def_common_attribute_with_nothing(name) \
22096 template<typename T>\
22099 #define def_special_attribute_with_nothing(name) \
22102 #define common_attribute_t template<class>class
22103 #define special_attribute_t class
22113 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
22115 #define enabled_by_default class enable_state=void
22117 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
22119 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
22121 #define enable_flag class enable_state
22123 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
22124 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
22125 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
22126 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
22127 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
22130 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
22132 #define get_recursive_lambda_caller(name) \
22133 lambda_with_catch(&)(auto&&...Args){\
22134 return name(name,Args...);\
22139 #define lambda_with_catch(...) [__VA_ARGS__]
22141 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
22143 #define lambda_RLSRRS _my_jb_super_sb_name_
22151 #define elseif else if
22153 #define _big_than_ >
22155 #define _small_than_ <
22157 #if defined(_MSC_VER)
22164 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
22166 #define BREAK_NAMESPACE }
22169 #define template_name template
22171 #define type_name class
22173 #if defined(DEBUG) || defined(_DEBUG)
22174 #define not_in_debug 0
22176 #define not_in_debug 1
22180 #define ec(ch) U ## ch
22182 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
22183 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
22185 #define ELC_TEST_EVENTNAME(name)
22188 #define override_instance_struct \
22190 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
22191 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
22192 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
22193 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
22194 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
22196 #if defined(_WIN32)
22197 #define distinctive __declspec(dllexport)
22199 #define distinctive
22202 #if defined(_WIN32)
22203 #define force_inline __forceinline
22204 #elif defined(__GNUC__)
22205 #define force_inline __attribute__((always_inline)) inline
22207 #define force_inline inline
22210 #if defined(_WIN32)
22211 #define with_no_vtable __declspec(novtable)
22213 #define with_no_vtable
22216 #define in_consteval (::std::is_constant_evaluated())
22218 #define no_vtable_struct struct with_no_vtable
22219 #define no_vtable_class class with_no_vtable
22223 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
22227 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22229 #if defined(ELC_TEST_ON)
22230 namespace literal_part_test{
22231 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_test.hpp"
22239 inline void test(){
22240 ELC_TEST_EVENTNAME(
"literal部分测试");
22242 inline void test_log_out(){
22244 inline void test_end{
22249 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22253 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22261 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
22272 #if defined(_MSC_VER)
22273 #pragma warning(pop)
22275 #undef suppress_msvc_warning
22276 #undef disable_msvc_warning
22277 #undef push_msvc_warning
22278 #undef pop_msvc_warning
22279 #undef push_and_disable_msvc_warning
22282 #undef BIT_POSSIBILITY
22284 #if defined(ELC_VOID_NAME)
22285 #define void the_void
22290 #undef noexcept_as_auto
22291 #undef constexpr_as
22292 #undef constexpr_as_auto
22294 #undef using_method_from_base_t
22295 #undef using_method_from_value
22300 #undef re_declvalue
22305 #undef template_error
22306 #undef template_warning
22308 #undef type_info_of
22309 #undef type_name_of
22311 #undef is_common_attribute
22312 #undef is_special_attribute
22314 #undef has_attribute
22315 #undef not_has_attribute
22317 #undef float_size_of
22320 #undef def_common_attribute_with_nothing
22321 #undef def_special_attribute_with_nothing
22323 #undef common_attribute_t
22324 #undef special_attribute_t
22327 #undef enabled_by_default
22328 #undef disabled_by_default
22329 #undef enable_if_not_ill_form
22332 #undef was_an_ill_form
22333 #undef was_an_ill_form_with_parameter
22334 #undef was_not_an_ill_form
22335 #undef was_not_an_ill_form_and_noexcept
22336 #undef was_not_an_ill_form_with_parameter
22338 #undef recursive_lambda
22339 #undef get_recursive_lambda_caller
22341 #undef lambda_with_catch
22342 #undef self_recursion
22343 #undef lambda_RLSRRS
22351 #undef _small_than_
22353 #if defined(_MSC_VER)
22359 #undef INTER_NAMESPACE
22360 #undef BREAK_NAMESPACE
22365 #undef template_name
22368 #undef not_in_debug
22373 #undef ELC_TEST_EVENTNAME
22375 #undef override_instance_struct
22379 #undef force_inline
22381 #undef with_no_vtable
22383 #undef in_consteval
22385 #undef no_vtable_struct
22386 #undef no_vtable_class
22390 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22394 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22397 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_export.hpp"
22406 #define export using ::
22411 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/literal/_body.hpp"
22416 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/literal"
22421 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
22423 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/memory_stream"
22432 #if !defined(ELC_MEMORY_STREAM)
22433 #define ELC_MEMORY_STREAM
22434 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22443 #if defined(ELC_TEST)
22444 #error "this part cannot be tested."
22446 namespace elc::defs{
22447 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
22455 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22467 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22469 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
22480 #define BIT_POSSIBILITY 2
22484 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
22486 #if defined(_MSC_VER)
22487 #pragma warning(push,ELC_WARNING_LEVEL)
22488 #pragma warning(disable:4099)
22489 #pragma warning(disable:26812)
22490 #pragma warning(disable:4584)
22491 #pragma warning(disable:4250)
22492 #pragma warning(disable:26432)
22493 #pragma warning(disable:26435)
22494 #pragma warning(disable:26481)
22495 #pragma warning(disable:26446)
22496 #pragma warning(disable:26434)
22497 #pragma warning(disable:26429)
22498 #pragma warning(disable:26471)
22499 #pragma warning(disable:26474)
22500 #pragma warning(disable:26473)
22501 #pragma warning(disable:26456)
22502 #pragma warning(disable:26485)
22503 #pragma warning(disable:26490)
22504 #pragma warning(disable:26472)
22505 #pragma warning(disable:26482)
22506 #pragma warning(disable:26493)
22508 #if defined(_MSC_VER)
22509 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
22510 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
22511 #define push_msvc_warning() __pragma(warning(push))
22512 #define pop_msvc_warning() __pragma(warning(pop))
22513 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
22515 #define suppress_msvc_warning(...)
22516 #define disable_msvc_warning(...)
22517 #define push_msvc_warning()
22518 #define pop_msvc_warning()
22519 #define push_and_disable_msvc_warning(...)
22522 #if defined(ELC_VOID_NAME)
22527 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
22528 #define noexcept_as_auto MAGIC
22529 #define constexpr_as(...) MAGIC constexpr
22530 #define constexpr_as_auto MAGIC MAGIC constexpr
22532 #define using_method_from_base_t(name,...) \
22533 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
22534 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
22536 return base_t::name(forward<Args>(rest)...);\
22539 #define using_method_from_value(name,value_name,...) \
22540 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
22541 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
22543 return value_name.name(forward<Args>(rest)...);\
22546 #define floop while(__builtin_is_my_dick_still_there())
22547 #define enable_adl(name) void name()noexcept=delete
22549 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
22550 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
22552 #define declvalue(...) (::std::declval<__VA_ARGS__>())
22555 #define template_error(reason) static_assert(template_error_helper<T>,reason)
22557 #define template_warning(reason) template_warning_helper<T>(reason)
22560 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
22561 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
22563 #define is_common_attribute(name) public attribute<T,name<T>>
22564 #define is_special_attribute(name) public attribute<T,name>
22566 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
22567 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
22570 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
22572 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
22575 #define def_common_attribute_with_nothing(name) \
22576 template<typename T>\
22579 #define def_special_attribute_with_nothing(name) \
22582 #define common_attribute_t template<class>class
22583 #define special_attribute_t class
22593 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
22595 #define enabled_by_default class enable_state=void
22597 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
22599 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
22601 #define enable_flag class enable_state
22603 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
22604 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
22605 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
22606 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
22607 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
22610 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
22612 #define get_recursive_lambda_caller(name) \
22613 lambda_with_catch(&)(auto&&...Args){\
22614 return name(name,Args...);\
22619 #define lambda_with_catch(...) [__VA_ARGS__]
22621 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
22623 #define lambda_RLSRRS _my_jb_super_sb_name_
22631 #define elseif else if
22633 #define _big_than_ >
22635 #define _small_than_ <
22637 #if defined(_MSC_VER)
22644 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
22646 #define BREAK_NAMESPACE }
22649 #define template_name template
22651 #define type_name class
22653 #if defined(DEBUG) || defined(_DEBUG)
22654 #define not_in_debug 0
22656 #define not_in_debug 1
22660 #define ec(ch) U ## ch
22662 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
22663 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
22665 #define ELC_TEST_EVENTNAME(name)
22668 #define override_instance_struct \
22670 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
22671 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
22672 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
22673 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
22674 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
22676 #if defined(_WIN32)
22677 #define distinctive __declspec(dllexport)
22679 #define distinctive
22682 #if defined(_WIN32)
22683 #define force_inline __forceinline
22684 #elif defined(__GNUC__)
22685 #define force_inline __attribute__((always_inline)) inline
22687 #define force_inline inline
22690 #if defined(_WIN32)
22691 #define with_no_vtable __declspec(novtable)
22693 #define with_no_vtable
22696 #define in_consteval (::std::is_constant_evaluated())
22698 #define no_vtable_struct struct with_no_vtable
22699 #define no_vtable_class class with_no_vtable
22703 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
22707 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22709 namespace stream_n{
22710 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/memory_stream.hpp"
22724 _m = get<byte>[1024]();
22731 [[nodiscard]]
size_t bufsize()
const noexcept{
22732 return get_size_of_get(_m);
22734 virtual void* seek(seek_type st,int_t offsize)
noexcept override{
22740 _pos += (ptrdiff_t)offsize;
22749 virtual void seek_to(
void*p)
noexcept override{
22750 _pos = ((
byte*)p)-_m;
22752 virtual void sync()
noexcept override{
22755 virtual void flush()
noexcept override{
22758 virtual void close()
noexcept override{
22763 virtual void write(
const byte*buf,
size_t size)
noexcept override{
22764 if(size>this->bufsize()-_pos)
22765 get_resize(_m,get_next_gold_size_to_resize_for_array(_pos+size));
22766 ::std::memcpy(_m+_pos,buf,size);
22770 virtual size_t read(
byte*buf,
size_t size)
noexcept override{
22773 ::std::memcpy(buf,_m+_pos,size);
22781 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22784 #if defined(ELC_TEST_ON)
22785 namespace memory_stream_part_test{
22786 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_test.hpp"
22794 inline void test(){
22795 ELC_TEST_EVENTNAME(
"memory_stream部分测试");
22797 inline void test_log_out(){
22799 inline void test_end(){
22804 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22808 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22816 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
22827 #if defined(_MSC_VER)
22828 #pragma warning(pop)
22830 #undef suppress_msvc_warning
22831 #undef disable_msvc_warning
22832 #undef push_msvc_warning
22833 #undef pop_msvc_warning
22834 #undef push_and_disable_msvc_warning
22837 #undef BIT_POSSIBILITY
22839 #if defined(ELC_VOID_NAME)
22840 #define void the_void
22845 #undef noexcept_as_auto
22846 #undef constexpr_as
22847 #undef constexpr_as_auto
22849 #undef using_method_from_base_t
22850 #undef using_method_from_value
22855 #undef re_declvalue
22860 #undef template_error
22861 #undef template_warning
22863 #undef type_info_of
22864 #undef type_name_of
22866 #undef is_common_attribute
22867 #undef is_special_attribute
22869 #undef has_attribute
22870 #undef not_has_attribute
22872 #undef float_size_of
22875 #undef def_common_attribute_with_nothing
22876 #undef def_special_attribute_with_nothing
22878 #undef common_attribute_t
22879 #undef special_attribute_t
22882 #undef enabled_by_default
22883 #undef disabled_by_default
22884 #undef enable_if_not_ill_form
22887 #undef was_an_ill_form
22888 #undef was_an_ill_form_with_parameter
22889 #undef was_not_an_ill_form
22890 #undef was_not_an_ill_form_and_noexcept
22891 #undef was_not_an_ill_form_with_parameter
22893 #undef recursive_lambda
22894 #undef get_recursive_lambda_caller
22896 #undef lambda_with_catch
22897 #undef self_recursion
22898 #undef lambda_RLSRRS
22906 #undef _small_than_
22908 #if defined(_MSC_VER)
22914 #undef INTER_NAMESPACE
22915 #undef BREAK_NAMESPACE
22920 #undef template_name
22923 #undef not_in_debug
22928 #undef ELC_TEST_EVENTNAME
22930 #undef override_instance_struct
22934 #undef force_inline
22936 #undef with_no_vtable
22938 #undef in_consteval
22940 #undef no_vtable_struct
22941 #undef no_vtable_class
22945 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
22949 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22952 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_export.hpp"
22961 #define export using defs::
22962 export memory_stream;
22967 #line 28 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/memory_stream/_body.hpp"
22972 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/memory_stream"
22977 #line 20 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
22978 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
22987 #if !defined(ELC_NAMESPACE)
22988 #define ELC_NAMESPACE
22989 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
22998 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23002 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23003 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23012 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23016 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23017 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23026 #if defined(ELC_TEST)
23027 #error "this part cannot be tested."
23029 namespace elc::defs{
23030 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
23038 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23050 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23052 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
23063 #define BIT_POSSIBILITY 2
23067 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23069 #if defined(_MSC_VER)
23070 #pragma warning(push,ELC_WARNING_LEVEL)
23071 #pragma warning(disable:4099)
23072 #pragma warning(disable:26812)
23073 #pragma warning(disable:4584)
23074 #pragma warning(disable:4250)
23075 #pragma warning(disable:26432)
23076 #pragma warning(disable:26435)
23077 #pragma warning(disable:26481)
23078 #pragma warning(disable:26446)
23079 #pragma warning(disable:26434)
23080 #pragma warning(disable:26429)
23081 #pragma warning(disable:26471)
23082 #pragma warning(disable:26474)
23083 #pragma warning(disable:26473)
23084 #pragma warning(disable:26456)
23085 #pragma warning(disable:26485)
23086 #pragma warning(disable:26490)
23087 #pragma warning(disable:26472)
23088 #pragma warning(disable:26482)
23089 #pragma warning(disable:26493)
23091 #if defined(_MSC_VER)
23092 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
23093 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
23094 #define push_msvc_warning() __pragma(warning(push))
23095 #define pop_msvc_warning() __pragma(warning(pop))
23096 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
23098 #define suppress_msvc_warning(...)
23099 #define disable_msvc_warning(...)
23100 #define push_msvc_warning()
23101 #define pop_msvc_warning()
23102 #define push_and_disable_msvc_warning(...)
23105 #if defined(ELC_VOID_NAME)
23110 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
23111 #define noexcept_as_auto MAGIC
23112 #define constexpr_as(...) MAGIC constexpr
23113 #define constexpr_as_auto MAGIC MAGIC constexpr
23115 #define using_method_from_base_t(name,...) \
23116 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
23117 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
23119 return base_t::name(forward<Args>(rest)...);\
23122 #define using_method_from_value(name,value_name,...) \
23123 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
23124 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
23126 return value_name.name(forward<Args>(rest)...);\
23129 #define floop while(__builtin_is_my_dick_still_there())
23130 #define enable_adl(name) void name()noexcept=delete
23132 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
23133 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
23135 #define declvalue(...) (::std::declval<__VA_ARGS__>())
23138 #define template_error(reason) static_assert(template_error_helper<T>,reason)
23140 #define template_warning(reason) template_warning_helper<T>(reason)
23143 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
23144 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
23146 #define is_common_attribute(name) public attribute<T,name<T>>
23147 #define is_special_attribute(name) public attribute<T,name>
23149 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
23150 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
23153 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
23155 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
23158 #define def_common_attribute_with_nothing(name) \
23159 template<typename T>\
23162 #define def_special_attribute_with_nothing(name) \
23165 #define common_attribute_t template<class>class
23166 #define special_attribute_t class
23176 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
23178 #define enabled_by_default class enable_state=void
23180 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
23182 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
23184 #define enable_flag class enable_state
23186 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
23187 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
23188 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
23189 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
23190 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
23193 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
23195 #define get_recursive_lambda_caller(name) \
23196 lambda_with_catch(&)(auto&&...Args){\
23197 return name(name,Args...);\
23202 #define lambda_with_catch(...) [__VA_ARGS__]
23204 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
23206 #define lambda_RLSRRS _my_jb_super_sb_name_
23214 #define elseif else if
23216 #define _big_than_ >
23218 #define _small_than_ <
23220 #if defined(_MSC_VER)
23227 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
23229 #define BREAK_NAMESPACE }
23232 #define template_name template
23234 #define type_name class
23236 #if defined(DEBUG) || defined(_DEBUG)
23237 #define not_in_debug 0
23239 #define not_in_debug 1
23243 #define ec(ch) U ## ch
23245 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
23246 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
23248 #define ELC_TEST_EVENTNAME(name)
23251 #define override_instance_struct \
23253 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
23254 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
23255 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
23256 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
23257 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
23259 #if defined(_WIN32)
23260 #define distinctive __declspec(dllexport)
23262 #define distinctive
23265 #if defined(_WIN32)
23266 #define force_inline __forceinline
23267 #elif defined(__GNUC__)
23268 #define force_inline __attribute__((always_inline)) inline
23270 #define force_inline inline
23273 #if defined(_WIN32)
23274 #define with_no_vtable __declspec(novtable)
23276 #define with_no_vtable
23279 #define in_consteval (::std::is_constant_evaluated())
23281 #define no_vtable_struct struct with_no_vtable
23282 #define no_vtable_class class with_no_vtable
23286 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
23290 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23292 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/defs.hpp"
23302 distinctive
inline map_t<ptr,string> long_term_binary_node_storager<string>{};
23304 namespace namespace_n{
23306 ptr _namespace_root;
23307 weak_ptr _namespace_now;
23308 value get_symbol_type_map(ptr thenamespace){
23309 return (*thenamespace)[es
".symbol_type_map"];
23312 _namespace_root = get<common_node>();
23313 auto&nmsp = *_namespace_root;
23314 _namespace_now = &nmsp;
23315 push_and_disable_msvc_warning(26447);
23316 nmsp[es
".."] = the_void;
23317 nmsp[es
"."] = nmsp;
23319 nmsp[es
"nil"] = nil;
23320 nmsp[es
"void"] = the_void;
23321 value nmsptm = get_symbol_type_map(&nmsp);
23322 nmsptm = get<common_node>();
23323 nmsptm[es
"void"] = es
"void";
23324 pop_msvc_warning();
23326 ptr get_symbol_namespace(
const value index){
23327 ptr namespace_now_p = _namespace_now;
23328 while(namespace_now_p && !(*namespace_now_p)[index] && !get_symbol_type_map(namespace_now_p)[index])
23329 namespace_now_p = (*namespace_now_p)[es
".."];
23330 return namespace_now_p;
23332 ptr get_symbol_namespace(
auto&& index){
return get_symbol_namespace(as_value(index)); }
23333 bool has_symbol(
const value index){
23334 auto nmsp=get_symbol_namespace(index);
23335 if((*nmsp)[index] || get_symbol_type_map(nmsp)[index])
23339 bool has_symbol(
auto&& index){
return has_symbol(as_value(index)); }
23340 value get_symbol(
const value index){
23341 return (*get_symbol_namespace(index))[index];
23343 value get_symbol(
auto&& index){
return get_symbol(as_value(index)); }
23344 value get_symbol_type(
const value index){
23345 return get_symbol_type_map(get_symbol_namespace(index))[index];
23347 value get_symbol_type(
auto&& index){
return get_symbol_type(as_value(index)); }
23349 void inter_namespace(
const value namespace_name){
23350 _namespace_now = get_symbol(namespace_name);
23352 void inter_namespace(
auto&& index){ inter_namespace(as_value(index)); }
23354 void leave_namespace(){ inter_namespace(es
".."); }
23360 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23362 #if defined(ELC_TEST_ON)
23363 namespace namespace_part_test{
23364 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_test.hpp"
23372 inline void test(){
23373 ELC_TEST_EVENTNAME(
"namespace部分测试");
23375 inline void test_log_out(){
23377 inline void test_end{
23382 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23386 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
23394 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
23405 #if defined(_MSC_VER)
23406 #pragma warning(pop)
23408 #undef suppress_msvc_warning
23409 #undef disable_msvc_warning
23410 #undef push_msvc_warning
23411 #undef pop_msvc_warning
23412 #undef push_and_disable_msvc_warning
23415 #undef BIT_POSSIBILITY
23417 #if defined(ELC_VOID_NAME)
23418 #define void the_void
23423 #undef noexcept_as_auto
23424 #undef constexpr_as
23425 #undef constexpr_as_auto
23427 #undef using_method_from_base_t
23428 #undef using_method_from_value
23433 #undef re_declvalue
23438 #undef template_error
23439 #undef template_warning
23441 #undef type_info_of
23442 #undef type_name_of
23444 #undef is_common_attribute
23445 #undef is_special_attribute
23447 #undef has_attribute
23448 #undef not_has_attribute
23450 #undef float_size_of
23453 #undef def_common_attribute_with_nothing
23454 #undef def_special_attribute_with_nothing
23456 #undef common_attribute_t
23457 #undef special_attribute_t
23460 #undef enabled_by_default
23461 #undef disabled_by_default
23462 #undef enable_if_not_ill_form
23465 #undef was_an_ill_form
23466 #undef was_an_ill_form_with_parameter
23467 #undef was_not_an_ill_form
23468 #undef was_not_an_ill_form_and_noexcept
23469 #undef was_not_an_ill_form_with_parameter
23471 #undef recursive_lambda
23472 #undef get_recursive_lambda_caller
23474 #undef lambda_with_catch
23475 #undef self_recursion
23476 #undef lambda_RLSRRS
23484 #undef _small_than_
23486 #if defined(_MSC_VER)
23492 #undef INTER_NAMESPACE
23493 #undef BREAK_NAMESPACE
23498 #undef template_name
23501 #undef not_in_debug
23506 #undef ELC_TEST_EVENTNAME
23508 #undef override_instance_struct
23512 #undef force_inline
23514 #undef with_no_vtable
23516 #undef in_consteval
23518 #undef no_vtable_struct
23519 #undef no_vtable_class
23523 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
23527 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23530 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_export.hpp"
23539 #define export using defs::
23540 export namespace_n::names;
23545 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/namespace/_body.hpp"
23550 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/namespace"
23555 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
23556 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
23565 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/numerical_representation"
23569 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
23570 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23579 #if !defined(ELC_PACKAGE_SYMBOL_LOADER)
23580 #define ELC_PACKAGE_SYMBOL_LOADER
23581 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23590 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/core"
23594 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23595 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23604 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23608 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23609 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
23618 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/lib_loader"
23622 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
23623 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
23632 #if defined(ELC_TEST)
23633 #error "this part cannot be tested."
23637 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
23650 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/locale/using.hpp"
23654 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
23657 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23665 #if !defined(ELC_PATHS)
23667 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
23676 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base_defs"
23680 #line 10 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23681 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23690 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
23694 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23695 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
23708 #line 70 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/str_code_convert.hpp"
23712 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23714 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/decl_system_type.hpp"
23726 #if defined(__linux)||defined(__linux__)||defined(__gnu_linux__)
23727 #define SYSTEM_TYPE linux
23728 #elif defined(_WIN32)||defined(__MINGW32__)||defined(__CYGWIN__)
23729 #define SYSTEM_TYPE windows
23731 #define SYSTEM_TYPE other
23733 #define ERROR_MSG_UNABLE_OS "Unable OS,edit this file on your own or contact ELC's producers."
23737 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23739 #if SYSTEM_TYPE == windows
23740 #include <shlobj_core.h>
23741 #elif SYSTEM_TYPE == linux
23742 #include <unistd.h>
23747 namespace elc::paths{
23748 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23760 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23762 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
23773 #define BIT_POSSIBILITY 2
23777 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
23779 #if defined(_MSC_VER)
23780 #pragma warning(push,ELC_WARNING_LEVEL)
23781 #pragma warning(disable:4099)
23782 #pragma warning(disable:26812)
23783 #pragma warning(disable:4584)
23784 #pragma warning(disable:4250)
23785 #pragma warning(disable:26432)
23786 #pragma warning(disable:26435)
23787 #pragma warning(disable:26481)
23788 #pragma warning(disable:26446)
23789 #pragma warning(disable:26434)
23790 #pragma warning(disable:26429)
23791 #pragma warning(disable:26471)
23792 #pragma warning(disable:26474)
23793 #pragma warning(disable:26473)
23794 #pragma warning(disable:26456)
23795 #pragma warning(disable:26485)
23796 #pragma warning(disable:26490)
23797 #pragma warning(disable:26472)
23798 #pragma warning(disable:26482)
23799 #pragma warning(disable:26493)
23801 #if defined(_MSC_VER)
23802 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
23803 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
23804 #define push_msvc_warning() __pragma(warning(push))
23805 #define pop_msvc_warning() __pragma(warning(pop))
23806 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
23808 #define suppress_msvc_warning(...)
23809 #define disable_msvc_warning(...)
23810 #define push_msvc_warning()
23811 #define pop_msvc_warning()
23812 #define push_and_disable_msvc_warning(...)
23815 #if defined(ELC_VOID_NAME)
23820 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
23821 #define noexcept_as_auto MAGIC
23822 #define constexpr_as(...) MAGIC constexpr
23823 #define constexpr_as_auto MAGIC MAGIC constexpr
23825 #define using_method_from_base_t(name,...) \
23826 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
23827 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
23829 return base_t::name(forward<Args>(rest)...);\
23832 #define using_method_from_value(name,value_name,...) \
23833 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
23834 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
23836 return value_name.name(forward<Args>(rest)...);\
23839 #define floop while(__builtin_is_my_dick_still_there())
23840 #define enable_adl(name) void name()noexcept=delete
23842 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
23843 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
23845 #define declvalue(...) (::std::declval<__VA_ARGS__>())
23848 #define template_error(reason) static_assert(template_error_helper<T>,reason)
23850 #define template_warning(reason) template_warning_helper<T>(reason)
23853 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
23854 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
23856 #define is_common_attribute(name) public attribute<T,name<T>>
23857 #define is_special_attribute(name) public attribute<T,name>
23859 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
23860 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
23863 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
23865 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
23868 #define def_common_attribute_with_nothing(name) \
23869 template<typename T>\
23872 #define def_special_attribute_with_nothing(name) \
23875 #define common_attribute_t template<class>class
23876 #define special_attribute_t class
23886 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
23888 #define enabled_by_default class enable_state=void
23890 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
23892 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
23894 #define enable_flag class enable_state
23896 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
23897 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
23898 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
23899 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
23900 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
23903 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
23905 #define get_recursive_lambda_caller(name) \
23906 lambda_with_catch(&)(auto&&...Args){\
23907 return name(name,Args...);\
23912 #define lambda_with_catch(...) [__VA_ARGS__]
23914 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
23916 #define lambda_RLSRRS _my_jb_super_sb_name_
23924 #define elseif else if
23926 #define _big_than_ >
23928 #define _small_than_ <
23930 #if defined(_MSC_VER)
23937 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
23939 #define BREAK_NAMESPACE }
23942 #define template_name template
23944 #define type_name class
23946 #if defined(DEBUG) || defined(_DEBUG)
23947 #define not_in_debug 0
23949 #define not_in_debug 1
23953 #define ec(ch) U ## ch
23955 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
23956 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
23958 #define ELC_TEST_EVENTNAME(name)
23961 #define override_instance_struct \
23963 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
23964 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
23965 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
23966 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
23967 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
23969 #if defined(_WIN32)
23970 #define distinctive __declspec(dllexport)
23972 #define distinctive
23975 #if defined(_WIN32)
23976 #define force_inline __forceinline
23977 #elif defined(__GNUC__)
23978 #define force_inline __attribute__((always_inline)) inline
23980 #define force_inline inline
23983 #if defined(_WIN32)
23984 #define with_no_vtable __declspec(novtable)
23986 #define with_no_vtable
23989 #define in_consteval (::std::is_constant_evaluated())
23991 #define no_vtable_struct struct with_no_vtable
23992 #define no_vtable_class class with_no_vtable
23996 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
23998 using namespace ::elc::defs;
24000 #if SYSTEM_TYPE == windows
24001 #define DYNAMIC_LIBRARY_SUFFIX ".dll"
24003 #define DYNAMIC_LIBRARY_SUFFIX ".so"
24006 [[nodiscard]]
inline bool file_exists(
const string&name)
noexcept{
24007 #if SYSTEM_TYPE == windows
24008 return GetFileAttributesA(to_char_str(name).c_str())!=INVALID_FILE_ATTRIBUTES;
24009 #elif SYSTEM_TYPE == linux
24010 return access(to_char_str(name).c_str(),F_OK)==0;
24012 auto fp = ::std::fopen(to_char_str(name).c_str(),
"rb");
24020 [[nodiscard]]
inline string get_program_data_path()noexcept{
24021 #if SYSTEM_TYPE == windows
24022 char path[MAX_PATH];
24023 if(!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path)))
24025 return to_char_t_str(path);
24026 #elif SYSTEM_TYPE == linux
24027 return es
"/usr/local/share"_constexpr_str;
24032 [[nodiscard]]
inline string get_system_drive()noexcept{
24033 #if SYSTEM_TYPE == windows
24034 char path[MAX_PATH];
24035 if(!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_WINDOWS, NULL, 0, path)))
24037 return to_char_t_str(path)+es
"\\.."_constexpr_str;
24038 #elif SYSTEM_TYPE == linux
24039 return es
"/"_constexpr_str;
24044 [[nodiscard]]
inline string get_elc_runtime_lib_path()noexcept{
24045 #if SYSTEM_TYPE == windows
24050 string program_data_path=get_program_data_path();
24051 if(program_data_path.size() && file_exists(program_data_path + es
"/elc/flag"_constexpr_str))
24052 return program_data_path+es
"/elc"_constexpr_str;
24055 string system_drive=get_system_drive();
24056 if(system_drive.size() && file_exists(system_drive + es
"/elc/flag"_constexpr_str))
24057 return system_drive+es
"/elc"_constexpr_str;
24059 #elif SYSTEM_TYPE == linux
24062 string flag_path=es
"/usr/lib/elc/flag"_constexpr_str;
24063 if(file_exists(flag_path))
24064 return es
"/usr/lib/elc"_constexpr_str;
24066 return es
"./elc"_constexpr_str;
24069 inline constexpr auto package_symbol_loader_file_name = es
"package_symbol_loader" DYNAMIC_LIBRARY_SUFFIX
""_constexpr_str;
24071 push_and_disable_msvc_warning(26426);
24072 distinctive
inline string elc_runtime_lib_path=defs::get_elc_runtime_lib_path();
24073 distinctive
inline string package_symbol_loader_path = elc_runtime_lib_path+es
"/"_constexpr_str+package_symbol_loader_file_name;
24074 pop_msvc_warning();
24076 #undef DYNAMIC_LIBRARY_SUFFIX
24078 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
24089 #if defined(_MSC_VER)
24090 #pragma warning(pop)
24092 #undef suppress_msvc_warning
24093 #undef disable_msvc_warning
24094 #undef push_msvc_warning
24095 #undef pop_msvc_warning
24096 #undef push_and_disable_msvc_warning
24099 #undef BIT_POSSIBILITY
24101 #if defined(ELC_VOID_NAME)
24102 #define void the_void
24107 #undef noexcept_as_auto
24108 #undef constexpr_as
24109 #undef constexpr_as_auto
24111 #undef using_method_from_base_t
24112 #undef using_method_from_value
24117 #undef re_declvalue
24122 #undef template_error
24123 #undef template_warning
24125 #undef type_info_of
24126 #undef type_name_of
24128 #undef is_common_attribute
24129 #undef is_special_attribute
24131 #undef has_attribute
24132 #undef not_has_attribute
24134 #undef float_size_of
24137 #undef def_common_attribute_with_nothing
24138 #undef def_special_attribute_with_nothing
24140 #undef common_attribute_t
24141 #undef special_attribute_t
24144 #undef enabled_by_default
24145 #undef disabled_by_default
24146 #undef enable_if_not_ill_form
24149 #undef was_an_ill_form
24150 #undef was_an_ill_form_with_parameter
24151 #undef was_not_an_ill_form
24152 #undef was_not_an_ill_form_and_noexcept
24153 #undef was_not_an_ill_form_with_parameter
24155 #undef recursive_lambda
24156 #undef get_recursive_lambda_caller
24158 #undef lambda_with_catch
24159 #undef self_recursion
24160 #undef lambda_RLSRRS
24168 #undef _small_than_
24170 #if defined(_MSC_VER)
24176 #undef INTER_NAMESPACE
24177 #undef BREAK_NAMESPACE
24182 #undef template_name
24185 #undef not_in_debug
24190 #undef ELC_TEST_EVENTNAME
24192 #undef override_instance_struct
24196 #undef force_inline
24198 #undef with_no_vtable
24200 #undef in_consteval
24202 #undef no_vtable_struct
24203 #undef no_vtable_class
24207 #line 107 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
24210 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/APIs/_tools/undef_decl_system_type.hpp"
24223 #undef ERROR_MSG_UNABLE_OS
24227 #line 110 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/paths.hpp"
24232 #line 15 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24233 namespace elc::defs{
24234 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
24242 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24254 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24256 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
24267 #define BIT_POSSIBILITY 2
24271 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24273 #if defined(_MSC_VER)
24274 #pragma warning(push,ELC_WARNING_LEVEL)
24275 #pragma warning(disable:4099)
24276 #pragma warning(disable:26812)
24277 #pragma warning(disable:4584)
24278 #pragma warning(disable:4250)
24279 #pragma warning(disable:26432)
24280 #pragma warning(disable:26435)
24281 #pragma warning(disable:26481)
24282 #pragma warning(disable:26446)
24283 #pragma warning(disable:26434)
24284 #pragma warning(disable:26429)
24285 #pragma warning(disable:26471)
24286 #pragma warning(disable:26474)
24287 #pragma warning(disable:26473)
24288 #pragma warning(disable:26456)
24289 #pragma warning(disable:26485)
24290 #pragma warning(disable:26490)
24291 #pragma warning(disable:26472)
24292 #pragma warning(disable:26482)
24293 #pragma warning(disable:26493)
24295 #if defined(_MSC_VER)
24296 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
24297 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
24298 #define push_msvc_warning() __pragma(warning(push))
24299 #define pop_msvc_warning() __pragma(warning(pop))
24300 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
24302 #define suppress_msvc_warning(...)
24303 #define disable_msvc_warning(...)
24304 #define push_msvc_warning()
24305 #define pop_msvc_warning()
24306 #define push_and_disable_msvc_warning(...)
24309 #if defined(ELC_VOID_NAME)
24314 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
24315 #define noexcept_as_auto MAGIC
24316 #define constexpr_as(...) MAGIC constexpr
24317 #define constexpr_as_auto MAGIC MAGIC constexpr
24319 #define using_method_from_base_t(name,...) \
24320 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
24321 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
24323 return base_t::name(forward<Args>(rest)...);\
24326 #define using_method_from_value(name,value_name,...) \
24327 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
24328 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
24330 return value_name.name(forward<Args>(rest)...);\
24333 #define floop while(__builtin_is_my_dick_still_there())
24334 #define enable_adl(name) void name()noexcept=delete
24336 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
24337 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
24339 #define declvalue(...) (::std::declval<__VA_ARGS__>())
24342 #define template_error(reason) static_assert(template_error_helper<T>,reason)
24344 #define template_warning(reason) template_warning_helper<T>(reason)
24347 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
24348 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
24350 #define is_common_attribute(name) public attribute<T,name<T>>
24351 #define is_special_attribute(name) public attribute<T,name>
24353 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
24354 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
24357 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
24359 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
24362 #define def_common_attribute_with_nothing(name) \
24363 template<typename T>\
24366 #define def_special_attribute_with_nothing(name) \
24369 #define common_attribute_t template<class>class
24370 #define special_attribute_t class
24380 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
24382 #define enabled_by_default class enable_state=void
24384 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
24386 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
24388 #define enable_flag class enable_state
24390 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
24391 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
24392 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
24393 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
24394 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
24397 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
24399 #define get_recursive_lambda_caller(name) \
24400 lambda_with_catch(&)(auto&&...Args){\
24401 return name(name,Args...);\
24406 #define lambda_with_catch(...) [__VA_ARGS__]
24408 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
24410 #define lambda_RLSRRS _my_jb_super_sb_name_
24418 #define elseif else if
24420 #define _big_than_ >
24422 #define _small_than_ <
24424 #if defined(_MSC_VER)
24431 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
24433 #define BREAK_NAMESPACE }
24436 #define template_name template
24438 #define type_name class
24440 #if defined(DEBUG) || defined(_DEBUG)
24441 #define not_in_debug 0
24443 #define not_in_debug 1
24447 #define ec(ch) U ## ch
24449 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
24450 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
24452 #define ELC_TEST_EVENTNAME(name)
24455 #define override_instance_struct \
24457 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
24458 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
24459 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
24460 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
24461 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
24463 #if defined(_WIN32)
24464 #define distinctive __declspec(dllexport)
24466 #define distinctive
24469 #if defined(_WIN32)
24470 #define force_inline __forceinline
24471 #elif defined(__GNUC__)
24472 #define force_inline __attribute__((always_inline)) inline
24474 #define force_inline inline
24477 #if defined(_WIN32)
24478 #define with_no_vtable __declspec(novtable)
24480 #define with_no_vtable
24483 #define in_consteval (::std::is_constant_evaluated())
24485 #define no_vtable_struct struct with_no_vtable
24486 #define no_vtable_class class with_no_vtable
24490 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
24494 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24496 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/package_symbol_loader.hpp"
24504 namespace package_symbol_loader_n{
24506 library_handle_t package_symbol_loader_handle;
24507 function_t<ptr(
string lib_name,
size_t lib_ver,
string symbol_name)
noexcept> load_interface;
24508 function_t<ptr()
noexcept> load_error_interface;
24511 if(package_symbol_loader_handle = load_lib(paths::package_symbol_loader_path)){
24512 load_interface = package_symbol_loader_handle->get_symbol_as_function<ptr(
string lib_name,
size_t lib_ver,
string symbol_name)
noexcept>(es
"load_interface");
24513 load_error_interface = package_symbol_loader_handle->get_symbol_as_function<ptr()
noexcept>(es
"load_error_interface");
24516 die_with(locale::str::package_symbol_loader::load_failed);
24517 if(!load_interface)
24518 die_with(locale::str::package_symbol_loader::load_interface_failed);
24522 ptr load_symbol(
string lib_name,
size_t lib_ver,
string symbol_name)
noexcept{
24523 return load_interface(lib_name,lib_ver,symbol_name);
24525 ptr get_load_error()
noexcept{
24526 return load_error_interface();
24532 #line 19 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24533 #if defined(ELC_TEST_ON)
24534 namespace package_symbol_loader_part_test{
24535 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_test.hpp"
24543 inline void test(){
24544 ELC_TEST_EVENTNAME(
"package_symbol_loader部分测试");
24546 inline void test_log_out(){}
24547 inline void test_end{}
24551 #line 22 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24555 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
24563 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
24574 #if defined(_MSC_VER)
24575 #pragma warning(pop)
24577 #undef suppress_msvc_warning
24578 #undef disable_msvc_warning
24579 #undef push_msvc_warning
24580 #undef pop_msvc_warning
24581 #undef push_and_disable_msvc_warning
24584 #undef BIT_POSSIBILITY
24586 #if defined(ELC_VOID_NAME)
24587 #define void the_void
24592 #undef noexcept_as_auto
24593 #undef constexpr_as
24594 #undef constexpr_as_auto
24596 #undef using_method_from_base_t
24597 #undef using_method_from_value
24602 #undef re_declvalue
24607 #undef template_error
24608 #undef template_warning
24610 #undef type_info_of
24611 #undef type_name_of
24613 #undef is_common_attribute
24614 #undef is_special_attribute
24616 #undef has_attribute
24617 #undef not_has_attribute
24619 #undef float_size_of
24622 #undef def_common_attribute_with_nothing
24623 #undef def_special_attribute_with_nothing
24625 #undef common_attribute_t
24626 #undef special_attribute_t
24629 #undef enabled_by_default
24630 #undef disabled_by_default
24631 #undef enable_if_not_ill_form
24634 #undef was_an_ill_form
24635 #undef was_an_ill_form_with_parameter
24636 #undef was_not_an_ill_form
24637 #undef was_not_an_ill_form_and_noexcept
24638 #undef was_not_an_ill_form_with_parameter
24640 #undef recursive_lambda
24641 #undef get_recursive_lambda_caller
24643 #undef lambda_with_catch
24644 #undef self_recursion
24645 #undef lambda_RLSRRS
24653 #undef _small_than_
24655 #if defined(_MSC_VER)
24661 #undef INTER_NAMESPACE
24662 #undef BREAK_NAMESPACE
24667 #undef template_name
24670 #undef not_in_debug
24675 #undef ELC_TEST_EVENTNAME
24677 #undef override_instance_struct
24681 #undef force_inline
24683 #undef with_no_vtable
24685 #undef in_consteval
24687 #undef no_vtable_struct
24688 #undef no_vtable_class
24692 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
24696 #line 26 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24699 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_export.hpp"
24708 #define export using defs::package_symbol_loader_n::
24714 #line 29 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/package_symbol_loader/_body.hpp"
24719 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/package_symbol_loader"
24724 #line 23 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
24725 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/stream"
24734 #if !defined(ELC_STREAM)
24736 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
24745 #line 18 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/base"
24749 #line 11 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/stream"
24750 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
24759 #if defined(ELC_TEST)
24760 #error "this part cannot be tested."
24762 namespace elc::defs{
24763 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
24771 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24783 #line 14 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24785 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/basic_environment.hpp"
24796 #define BIT_POSSIBILITY 2
24800 #line 16 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_defs.hpp"
24802 #if defined(_MSC_VER)
24803 #pragma warning(push,ELC_WARNING_LEVEL)
24804 #pragma warning(disable:4099)
24805 #pragma warning(disable:26812)
24806 #pragma warning(disable:4584)
24807 #pragma warning(disable:4250)
24808 #pragma warning(disable:26432)
24809 #pragma warning(disable:26435)
24810 #pragma warning(disable:26481)
24811 #pragma warning(disable:26446)
24812 #pragma warning(disable:26434)
24813 #pragma warning(disable:26429)
24814 #pragma warning(disable:26471)
24815 #pragma warning(disable:26474)
24816 #pragma warning(disable:26473)
24817 #pragma warning(disable:26456)
24818 #pragma warning(disable:26485)
24819 #pragma warning(disable:26490)
24820 #pragma warning(disable:26472)
24821 #pragma warning(disable:26482)
24822 #pragma warning(disable:26493)
24824 #if defined(_MSC_VER)
24825 #define suppress_msvc_warning(...) __pragma(warning(suppress:__VA_ARGS__))
24826 #define disable_msvc_warning(...) __pragma(warning(disable:__VA_ARGS__))
24827 #define push_msvc_warning() __pragma(warning(push))
24828 #define pop_msvc_warning() __pragma(warning(pop))
24829 #define push_and_disable_msvc_warning(...) push_msvc_warning() disable_msvc_warning(__VA_ARGS__)
24831 #define suppress_msvc_warning(...)
24832 #define disable_msvc_warning(...)
24833 #define push_msvc_warning()
24834 #define pop_msvc_warning()
24835 #define push_and_disable_msvc_warning(...)
24838 #if defined(ELC_VOID_NAME)
24843 #define noexcept_as(...) noexcept(noexcept((__VA_ARGS__)))
24844 #define noexcept_as_auto MAGIC
24845 #define constexpr_as(...) MAGIC constexpr
24846 #define constexpr_as_auto MAGIC MAGIC constexpr
24848 #define using_method_from_base_t(name,...) \
24849 template<class...Args> requires was_not_an_ill_form(declvalue(base_t).name(declvalue(Args)...))\
24850 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(base_t::name(declvalue(Args)...))\
24852 return base_t::name(forward<Args>(rest)...);\
24855 #define using_method_from_value(name,value_name,...) \
24856 template<class...Args> requires was_not_an_ill_form(re_declvalue(value_name).name(declvalue(Args)...))\
24857 auto name(Args&&...rest)__VA_ARGS__ noexcept_as(re_declvalue(value_name).name(declvalue(Args)...))\
24859 return value_name.name(forward<Args>(rest)...);\
24862 #define floop while(__builtin_is_my_dick_still_there())
24863 #define enable_adl(name) void name()noexcept=delete
24865 #define re_declvalue(...) (declvalue(decltype(__VA_ARGS__)))
24866 #define re_decltype(...) (decltype(declvalue(__VA_ARGS__)))
24868 #define declvalue(...) (::std::declval<__VA_ARGS__>())
24871 #define template_error(reason) static_assert(template_error_helper<T>,reason)
24873 #define template_warning(reason) template_warning_helper<T>(reason)
24876 #define type_info_of(...) base_type_info_t(typeid(__VA_ARGS__))
24877 #define type_name_of(...) (type_info_of(__VA_ARGS__).name())
24879 #define is_common_attribute(name) public attribute<T,name<T>>
24880 #define is_special_attribute(name) public attribute<T,name>
24882 #define has_attribute(...) template_name has_attribute_helper<__VA_ARGS__>()
24883 #define not_has_attribute(...) template_name not_has_has_attribute_helper<__VA_ARGS__>()
24886 #define float_size_of(...) (float_size_t{sizeof(__VA_ARGS__)})
24888 #define bitnum_of(...) (bitnumof<__VA_ARGS__>)
24891 #define def_common_attribute_with_nothing(name) \
24892 template<typename T>\
24895 #define def_special_attribute_with_nothing(name) \
24898 #define common_attribute_t template<class>class
24899 #define special_attribute_t class
24909 #define enable_if(...) class enable_state= ::std::enable_if_t<__VA_ARGS__>
24911 #define enabled_by_default class enable_state=void
24913 #define disabled_by_default class enable_state= ::std::enable_if_t<false>
24915 #define enable_if_not_ill_form(...) class enable_state= ::std::void_t<decltype(__VA_ARGS__)>
24917 #define enable_flag class enable_state
24919 #define was_an_ill_form(...) (!was_not_an_ill_form(__VA_ARGS__))
24920 #define was_an_ill_form_with_parameter(...) (!was_not_an_ill_form_with_parameter(__VA_ARGS__))
24921 #define was_not_an_ill_form(...) (bool(requires{__VA_ARGS__;}))
24922 #define was_not_an_ill_form_and_noexcept(...) (bool(requires{__VA_ARGS__;{__VA_ARGS__}noexcept;}))
24923 #define was_not_an_ill_form_with_parameter(...) (bool(requires __VA_ARGS__ ))
24926 #define recursive_lambda(...) lambda(auto&&lambda_RLSRRS,__VA_ARGS__)
24928 #define get_recursive_lambda_caller(name) \
24929 lambda_with_catch(&)(auto&&...Args){\
24930 return name(name,Args...);\
24935 #define lambda_with_catch(...) [__VA_ARGS__]
24937 #define self_recursion(...) lambda_RLSRRS(lambda_RLSRRS,__VA_ARGS__)
24939 #define lambda_RLSRRS _my_jb_super_sb_name_
24947 #define elseif else if
24949 #define _big_than_ >
24951 #define _small_than_ <
24953 #if defined(_MSC_VER)
24960 #define INTER_NAMESPACE(NAMESPACENAME) namespace NAMESPACENAME{
24962 #define BREAK_NAMESPACE }
24965 #define template_name template
24967 #define type_name class
24969 #if defined(DEBUG) || defined(_DEBUG)
24970 #define not_in_debug 0
24972 #define not_in_debug 1
24976 #define ec(ch) U ## ch
24978 #if defined(ELC_TEST_ON)||defined(ELC_TEST_CHECK_MEMORY_LACK)
24979 #define ELC_TEST_EVENTNAME(name) stest_eventer _the_stest_eventer__(L""name)
24981 #define ELC_TEST_EVENTNAME(name)
24984 #define override_instance_struct \
24986 virtual void abstract_method_unget_this()noexcept_as(instance_struct<this_t>::abstract_method_unget_this())override{instance_struct<this_t>::abstract_method_unget_this();}\
24987 virtual void* _abstract_method_copy_get_this()noexcept_as(instance_struct<this_t>::_abstract_method_copy_get_this())override{return instance_struct<this_t>::_abstract_method_copy_get_this();}\
24988 virtual void* _abstract_method_get_resize_this(size_t size)noexcept_as(instance_struct<this_t>::instance_struct<this_t>::_abstract_method_get_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_resize_this(size);}\
24989 virtual void* _abstract_method_get_forward_resize_this(size_t size)noexcept_as(instance_struct<this_t>::_abstract_method_get_forward_resize_this(size))override{return instance_struct<this_t>::_abstract_method_get_forward_resize_this(size);}\
24990 virtual size_t abstract_method_get_size_of_get_for_this()noexcept override{return instance_struct<this_t>::abstract_method_get_size_of_get_for_this();}
24992 #if defined(_WIN32)
24993 #define distinctive __declspec(dllexport)
24995 #define distinctive
24998 #if defined(_WIN32)
24999 #define force_inline __forceinline
25000 #elif defined(__GNUC__)
25001 #define force_inline __attribute__((always_inline)) inline
25003 #define force_inline inline
25006 #if defined(_WIN32)
25007 #define with_no_vtable __declspec(novtable)
25009 #define with_no_vtable
25012 #define in_consteval (::std::is_constant_evaluated())
25014 #define no_vtable_struct struct with_no_vtable
25015 #define no_vtable_class class with_no_vtable
25019 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_defs.hpp"
25023 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25025 #if defined(ELC_TEST_ON)
25026 namespace stream_part_test{
25027 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_test.hpp"
25035 inline void test(){
25036 ELC_TEST_EVENTNAME(
"stream部分测试");
25038 inline void test_log_out(){
25040 inline void test_end{
25045 #line 17 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25049 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
25057 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/../../../_share/_undefs.hpp"
25068 #if defined(_MSC_VER)
25069 #pragma warning(pop)
25071 #undef suppress_msvc_warning
25072 #undef disable_msvc_warning
25073 #undef push_msvc_warning
25074 #undef pop_msvc_warning
25075 #undef push_and_disable_msvc_warning
25078 #undef BIT_POSSIBILITY
25080 #if defined(ELC_VOID_NAME)
25081 #define void the_void
25086 #undef noexcept_as_auto
25087 #undef constexpr_as
25088 #undef constexpr_as_auto
25090 #undef using_method_from_base_t
25091 #undef using_method_from_value
25096 #undef re_declvalue
25101 #undef template_error
25102 #undef template_warning
25104 #undef type_info_of
25105 #undef type_name_of
25107 #undef is_common_attribute
25108 #undef is_special_attribute
25110 #undef has_attribute
25111 #undef not_has_attribute
25113 #undef float_size_of
25116 #undef def_common_attribute_with_nothing
25117 #undef def_special_attribute_with_nothing
25119 #undef common_attribute_t
25120 #undef special_attribute_t
25123 #undef enabled_by_default
25124 #undef disabled_by_default
25125 #undef enable_if_not_ill_form
25128 #undef was_an_ill_form
25129 #undef was_an_ill_form_with_parameter
25130 #undef was_not_an_ill_form
25131 #undef was_not_an_ill_form_and_noexcept
25132 #undef was_not_an_ill_form_with_parameter
25134 #undef recursive_lambda
25135 #undef get_recursive_lambda_caller
25137 #undef lambda_with_catch
25138 #undef self_recursion
25139 #undef lambda_RLSRRS
25147 #undef _small_than_
25149 #if defined(_MSC_VER)
25155 #undef INTER_NAMESPACE
25156 #undef BREAK_NAMESPACE
25161 #undef template_name
25164 #undef not_in_debug
25169 #undef ELC_TEST_EVENTNAME
25171 #undef override_instance_struct
25175 #undef force_inline
25177 #undef with_no_vtable
25179 #undef in_consteval
25181 #undef no_vtable_struct
25182 #undef no_vtable_class
25186 #line 8 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/_share/_undefs.hpp"
25190 #line 21 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25193 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_export.hpp"
25202 #define export using defs::
25207 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/_files/stream/_body.hpp"
25212 #line 12 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/stream"
25217 #line 24 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
25218 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
25227 #line 13 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/string"
25231 #line 25 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"
25233 #line 1 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/void_name"
25242 #if !defined(ELC_VOID_NAME)
25243 #define ELC_VOID_NAME
25244 typedef void the_void;
25245 #define void the_void
25250 #line 27 "https://github.com/ELC-lang/ELC/tree/master/parts/header_file/files/elc/all"